SendKeys Instruction
Syntax:
SendKeys Keys$[, Wait]
Group:
Miscellaneous
Description:
Send Keys$ to Windows.
Parameter
Description
Keys$ Send
the keys in this string value to Windows.
Wait If
this is not zero then the keys are sent before executing the next instruction.
If this is omitted or zero then the keys are sent during the following
instructions.
Keys$
Description
+ Shift modifier key: the following
key is a shifted key
^ Ctrl modifier key: the following
key is a control key
% Alt modifier key: the following
key is an alt key
~ Enter key
(keys) Modifiers apply to all keys
{special n} special key (n is an optional
repeat count)
k k Key (k is any single char)
K Shift k Key (K is any capital letter)
Special
Keys:
Key Description Key Description
k k Key (any single char) K shift k Key
Left Left Arrow Key
Cancel Break Key Right Right Arrow Key
Esc or Escape Up Up Arrow Key
Escape Key Down Down Arrow Key
Enter Enter Key PgUp Page Up Key
Menu Menu Key (Alt) PgDn Page Down Key
Help Help Key (?) Home Home Key
Prtsc Print Screen Key End End Key
Print ? Select ?
Execute ? Clear Num Pad 5 Key
Tab Tab Key Pad0 to Pad9
Pause Pause Key Num Pad 0-9 Keys
BS, BkSp or BackSpace Pad* Num Pad * Key
Back Space Key Pad+ Num Pad + Key
Del or Delete PadEnter Num Pad Enter
Delete Key Pad- Num Pad - Key
Ins or Insert Pad. Num Pad . Key
Insert Key Pad/ Num Pad / Key
F1 to F24 F1 to F24 Keys
See
Also: AppActivate, Shell(
).
Example:
Sub Main
SendKeys "%S" ' send Alt-S (Search)
SendKeys "GoTo~~" ' send G o T o {Enter} {Enter}
End Sub