KeyEvent¶
Import: import system.window;
Read the usage guide for examples and common tasks. This reference lists the public declarations for this part of the library. See Reading API signatures for parameter and result notation.
KeyEvent¶
One key press or release, carried by WindowEvent.KeyDown and WindowEvent.KeyUp.
code¶
The physical key, independent of the keyboard layout.
key¶
What the key prints on the active layout, such as "q" for KeyCode.A on AZERTY. Empty for keys that print nothing (arrows, function keys, modifiers) and when the platform cannot name the key. Use WindowEvent.Text for typed text.
modifiers¶
Modifier keys and lock states held when the event happened.
repeat¶
True when the operating system repeated a held key. Repeats never change KeyboardState.pressed.
constructor¶
Creates a key event. simulate uses events built this way to replay input.