SendKeys - Cheat Sheet


A quick cheatsheet for all the characters that can be sent using the sendkeys method:
e.g:
set WshShell = CreateObject("WScript.Shell") 
'Control+Shift+End
WshShell.SendKeys "^+{END}"


'Control+O
WshShell.SendKeys "^o"

Some common egs:
1. a and b are pressed, send the string argument : “(ab)”
2. To Send same letter multiple times : “{a 10}”
3. To Send ALT Tab :  wshell.sendkeys ” %{TAB}”
4. To Send ALT and space : wshell.sendkeys “%{ }”
5. TO Send char : wshell.Sendkeys “(a)”
6. Right Click of Mouse : Wshell.SendKeys “+{F10}”
7. Mouse Down : wshell.sendkeys “{DOWN}”
8. Mouse UP : wshell.sendkeys “{UP}”

KeyArgument
BACKSPACE{BACKSPACE}, {BS}, or {BKSP}
BREAK{BREAK}
CAPS LOCK{CAPSLOCK}
DEL or DELETE{DELETE} or {DEL}
DOWN ARROW{DOWN}
END{END}
ENTER{ENTER} or ~
ESC{ESC}
HELP{HELP}
HOME{HOME}
INS or INSERT{INSERT} or {INS}
LEFT ARROW{LEFT}
NUM LOCK{NUMLOCK}
PAGE DOWN{PGDN}
PAGE UP{PGUP}
PRINT SCREEN{PRTSC}
RIGHT ARROW{RIGHT}
SCROLL LOCK{SCROLLLOCK}
TAB{TAB}
UP ARROW{UP}
F1{F1}
F2{F2}
F3{F3}
F4{F4}
F5{F5}
F6{F6}
F7{F7}
F8{F8}
F9{F9}
F10{F10}
F11{F11}
F12{F12}
F13{F13}
F14{F14}
F15{F15}
F16{F16}
KeySpecial Character
SHIFT+
CTRL^
ALT%
 

Comments

  1. Hi friends,

    The site is about the different keys and their uses in software, now many testing tools are in market to get free of cost service. Thanks a lot.

    ReplyDelete
  2. Thanks for sharing your info. I really appreciate your efforts and I will be waiting for your further write ups thanks once again.
    IPhone App Development| Android apps developer|

    ReplyDelete
  3. Anonymous27/11/12

    Sendkeys down and up is simulating the down and up button not the mouse

    ReplyDelete

Post a Comment

Popular posts from this blog

XPATH for IE / internet explorer

Website's underlying technology for automation

All time good software testing books!