Home > FAQ > Useful Basic Tasks when writing a script > How do I find the window which has the focus?

Keyboard Mnemonics

SendKeys function cannot type special characters, those characters need to be replaced by their mnemonic as listed below.

For example, if you want to send the special character Tab into notepad, you need to replace Tab by "<Tab>".

shell("notepad")

UseWindow("NOTEPAD.EXE|Edit|",1)
'We want to type 3 then a tab then 5<10
a$="3"+"<Tab>"+"5"+"<Lower>"+"10"
SendKeys(a$)
  

Non-numeric keyboard mnemonics:

Mnemonic for SendKeys Key on keyboard

<F1> ... <F12>

F1 to F12

<CapsLock>

Caps Lock

<Tab>

Tab key

<Esc>

Escape

<Backspace>

Backspace

<ScrollLock>

Scroll Lock

<Ins>

Insert

<Del>

Delete

<Right>

Right arrow

<Left>

Left arrow

<Down>

Down arrow

<Up>

Up arrow

<PageUp>

Page Up

<PageDown>

Page Down

<Home>

Home

<End>

End

<Doublequote>

"

<Pipe>

| Symbol

<Lower>

< Symbol

<Greater>

> Symbol

<Enter>

Enter

<RCtrl>

Right Control

<Ctrl>

Left Control

<RShift>

Right Shift

<Shift>

Left Shift

 <Win>     Left Windows key 

<Alt>

Alt

<AltGr>

AltGr

<Pause>

Pause

<PrtSc>

Print Screen

Note there is no mnemonic for Space, use " " ( a space between the double quotes).

These keys can be modified by <Ctrl>, <Alt>, <Shift> and <RShift>.
Syntax is :
<Ctrl a>             ' Left Control a
<Shift <Ctrl a>> ' Left Shift Left Control a
<Ctrl <Shift <Alt a>>> ' Left Control Left Shift Alt a

(the space between each modifier is mandatory)

 

Numeric keyboard mnemonics. Syntax is the same but the reserved word "Num" is added.

<NumLock>

Locks the numeric keypad

<Num 0> ... <Num 9>

0 to 9 on the numeric keypad (if NumLock is on)

<Num .>

. on the numeric keypad

<Num +>

+ on the numeric keypad

<Num ->

- on the numeric keypad

<Num />

/ on the numeric keypad

<Num *>

* on the numeric keypad

<Num Enter>

Enter on the numeric keypad

<Num Left>

Left arrow on the numeric keypad

<Num Right>

Right arrow on the numeric keypad

<Num Down>

Down arrow on the numeric keypad

<Num Up>

Up arrow on the numeric keypad

<Num PageUp>

Page Up on the numeric keypad

<Num PageDown>

Page Down on the numeric keypad

<Num Home>

Home on the numeric keypad

<Num Insert>

Insert on the numeric keypad

<Num Del>

Delete on the numeric keypad

<None>

5 on the numeric keypad if NumLock is off