mojo.input.KeyboardDevice - nitrologic/monkey2 GitHub Wiki
mojo::mojo.input.KeyboardDevice
Class KeyboardDevice
The KeyboardDevice class.
To access the keyboard device, use the global Keyboard constant.
The keyboard device should only used after a new AppInstance is created.
All methods that take a key parameter can also be combined with 'raw' keys.
A raw key represents the physical location of a key on US keyboards. For example, Key.Q|Key.Raw indicates the key at the top left of the
QWERTY keys, as this is where the 'Q' key is on US keyboards.
| Properties | |
|---|---|
| Modifiers | The current state of the modifier keys. (read only) |
| Methods | |
|---|---|
| FlushChars | Flushes the character queue. |
| FlushKeys | Flushes all keyboard input. |
| GetChar | Gets the next character from the character queue. |
| KeyDown | Checks the current up/down state of a key. |
| KeyName | Gets the name of a key. |
| KeyPressed | Checks if a key was pressed. |
| KeyReleased | Checks if a key was released. |
| PeekChar | Peeks at the next character in the character queue. |
| TranslateKey | Translates a key to/from a raw key. |