getKeyCode
getKeyCode: (AwtKeyEvent) -> numberThe AWT key code (KeyEvent.VK_*); KeyEvent.VK_UNDEFINED (0) for a KEY_TYPED event.
| Method | Returns | Description |
|---|---|---|
getKeyCode() | number | The AWT key code (KeyEvent.VK_*); KeyEvent.VK_UNDEFINED (0) for a KEY_TYPED event. |
setKeyCode(number) | () | Makes the event this key instead: the game sees the new key, or, for a key the client has no code for, nothing. |
getExtendedKeyCode() | number | The key code with no keyboard-layout extension: on the layouts the client maps, the key code itself (what Keybind compares). |
getKeyChar() | string | The character, a one-character string: what was typed, for a KEY_TYPED event; for a press or release, the character the key makes on a US… |
setKeyCharacter(string) | () | Set the character, as a one-character string (Luau has no char). On a KEY_TYPED event the game types the new character instead; `KeyEve… |
getKeyLocation() | number | Where the key is: KeyEvent.KEY_LOCATION_STANDARD, _LEFT (the modifiers: the client does not tell left from right), _NUMPAD, or `_UNKN… |
isActionKey() | boolean | Whether the key types no character: arrows, F1..F24, Home/End, Page Up/Down, Insert, the lock keys, ... |
getExtendedKeyCodeForChar(number) | number | The key code for the character c (a code point, e.g. utf8.codepoint(s)), whatever the layout, reached through this class because the `K… |
getKeyCodegetKeyCode: (AwtKeyEvent) -> numberThe AWT key code (KeyEvent.VK_*); KeyEvent.VK_UNDEFINED (0) for a KEY_TYPED event.
setKeyCodesetKeyCode: (AwtKeyEvent, number) -> ()Makes the event this key instead: the game sees the new key, or, for a key the client has no code for, nothing.
getExtendedKeyCodegetExtendedKeyCode: (AwtKeyEvent) -> numberThe key code with no keyboard-layout extension: on the layouts the client maps, the key code itself (what Keybind compares).
getKeyChargetKeyChar: (AwtKeyEvent) -> stringThe character, a one-character string: what was typed, for a KEY_TYPED event; for a press or release, the character the key makes on a US layout, or KeyEvent.CHAR_UNDEFINED. A typed character is the one the client's own keyboard handler made: it maps WM_CHAR through a 256-entry table on the low byte, so a character above U+00FF is not the one AWT would report.
setKeyCharactersetKeyCharacter: (AwtKeyEvent, string) -> ()Set the character, as a one-character string (Luau has no char). On a KEY_TYPED event the game types the new character instead; KeyEvent.CHAR_UNDEFINED types nothing. Raises for a string that is not one UTF-16 unit.
getKeyLocationgetKeyLocation: (AwtKeyEvent) -> numberWhere the key is: KeyEvent.KEY_LOCATION_STANDARD, _LEFT (the modifiers: the client does not tell left from right), _NUMPAD, or _UNKNOWN for a KEY_TYPED event.
isActionKeyisActionKey: (AwtKeyEvent) -> booleanWhether the key types no character: arrows, F1..F24, Home/End, Page Up/Down, Insert, the lock keys, ...
getExtendedKeyCodeForChargetExtendedKeyCodeForChar: (number) -> numberThe key code for the character c (a code point, e.g. utf8.codepoint(s)), whatever the layout, reached through this class because the KeyEvent name is the constant table here. A letter of either case is its KeyEvent.VK_A..VK_Z, a digit its VK_0..VK_9; a symbol with a code of its own is that (! is VK_EXCLAMATION_MARK, not the 1 key); a character with a key on some layout is 0x01000000 + c; anything else KeyEvent.VK_UNDEFINED.