PressKeys Method (IKeyable)

Class

IKeyable.

Action

Presses (but does not release) a set of keys or mouse buttons.

Note: PressKeys is not supported for native mobile applications.

Valid keystrokes for all browsers except Internet Explorer include:
  • <Alt> (left-side Alt key)
  • <Ctrl> (Left-side Ctrl key)
  • <Shift> (Left-side Shift key)
Valid keystrokes for all other applications and for Internet Explorer include:
  • <#0>-<#9> (numeric keypad numbers 0-9 with Num Lock on)
  • <#Add> (numeric keypad '+')
  • <#Clear> (numeric keypad 5 with Num Lock off)
  • <#Decimal> (the key for the decimal separator on the numeric keypad of most keyboards)
  • <#Delete> (Numeric keypad '.' with Num Lock off)
  • <#Divide> (Numeric keypad '/')
  • <#Down> (numeric keypad 2 with Num Lock off)
  • <#End> (numeric keypad 1 with Num Lock off)
  • <#Enter> (numeric keypad Enter)
  • <#Equal> (numeric keypad equals sign)
  • <#Home> (numeric keypad 7 with Num Lock off)
  • <#Insert> (numeric keypad 0 with Num Lock off)
  • <#Left> (numeric keypad 4 with Num Lock off)
  • <#PgDn> (numeric keypad 3 with Num Lock off)
  • <#PgUp> (numeric keypad 9 with Num Lock off)
  • <#Right> (numeric keypad 6 with Num Lock off)
  • <#Separator> (numeric keypad Separator key)
  • <#Space> (numeric keypad Space key)
  • <#Subtract> (numeric keypad '-')
  • <#Tab> (numeric keypad Tab key)
  • <#Times> (numeric keypad '*')
  • <#Up> (numeric keypad 8 with Num Lock off)
  • <Alt> (left-side Alt key)
  • <Application> (opens a context menu on the last active control)
  • <Backspace> (backspace key)
  • <Break> (Ctrl-Break)
  • <Cancel> (break)
  • <CapsLock> (toggle whether it is currently on or off)
  • <Clear> (Clear key)
  • <Ctrl> (Left-side Ctrl key)
  • <Delete> (Delete key)
  • <Down> (Down arrow)
  • <End> (End key)
  • <Enter> (Enter key)
  • <Esc> (Escape)
  • <Execute> (Execute key)
  • <F1> - <F12> (F1 through F12 function keys)
  • <F13> - <F35> (F13 through F35 function keys)
  • <Greater> '>' key (which the agent would otherwise interpret as a right angle bracket)
  • <Help> (Help key)
  • <Home> (Home key)
  • <Insert> (Insert key)
  • <Left> (Left arrow)
  • <Left Alt> (Alt key)
  • <Left Ctrl> (Ctrl key)
  • <Left Shift> (Shift key)
  • <LeftWin> (Windows Start menu key)
  • <Cmd> (Mac OS Command key)
  • <Less> '<' key (which the agent would otherwise interpret as left angle bracket)
  • <Menu> (Menu key)
  • <Mode> (Mode key)
  • <Pause> (Pause)
  • <PgDn> (PgDn or Page Down)
  • <PgUp> (PgUp or Page Up)
  • <PrtScr> (Print Scrn)
  • <Redo> (Redo key)
  • <Right> (Right arrow)
  • <Right Alt> (Alt key)
  • <Right Ctrl> (Ctrl key)
  • <RightOption> (Option key)
  • <Right Shift> (Shift key)
  • <RightWin> (Windows Start menu key)
  • <ScrollLock> (typed whether it is currently on or off)
  • <Shift> (Left-side Shift key)
  • <Space> (Space bar)
  • <Tab> (Tab)
  • <Undo> (Undo key)
  • <Up> (Up arrow).

Note: '<' or '>' needs to be written as '<LessThan>' or '<GreaterThan>'.

Syntax

iKeyable.PressKeys(keys, [ensureFocus])
Variable Description
keys The keys to type or mouse buttons to press. String.
ensureFocus Optional: Determines whether it should be ensured that the control actually has the keyboard focus. Defaults to true. Boolean.

Examples

Examples: '<F4>', '<Left Shift>', '<Right Alt>', '<Left Ctrl>', '<Delete>', '<Backspace>'.