Keys
* class Key *
Applicable usage situations for these predefined constants of special keys and key modifiers can be found in Acting on a Region
and Low Level Mouse and Keyboard Actions
.
#
Special KeysThe methods supporting the use of special keys are
type()
keyDown()
keyUp()
Usage: Key.CONSTANT
(where CONSTANT is one of the following key names, uppercase mandatory).
String concatenation with with other text or other key constants is possible using `` + `_`.
miscellaneous keys
miscellaneous keys
function keys
navigation keys
special keys
:::Note The status ( on / off ) of the keys Key.CAPS_LOCK, Key.NUM_LOCK and Key.SCROLL_LOCK can be evaluated with the method Env.isLockOn(). :::
numpad keys
#
Key Modifiers#
modifier keysA key is called a modifier key, when it is used in conjunction with other keys by pressing and holding it while typing the other keys. The keys used most commonly as modifier keys are SHIFT, ALT (left alt key, CTRL (might be strg on Windows) and the CMD key (Apple key on OS X). On Windows you additionally have the Windows key and the alt key on the right.
the plain type()
command has 2 parameters:
- parameter 1: the keys, that should be pressed/released one after the other
- parameter 2: the modifier keys, that alltogether should be pressed and held during the typing and released at the end.
For parameter 2 there are 2 options:
- new version: (a key is a key ;-): Key.XXX
- old version (kept for upwards compatibility): KeyModifier.XXX
… and these early versions should not be used anymore
The modifier keys can be combined using`` + `_`
, if more than one key modifier is needed.
Note for Java programming:
These constants are mapped to the according constants of java.awt.event.InputEvent
.