mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-15 04:32:42 +00:00
40 lines
895 B
TypeScript
40 lines
895 B
TypeScript
/**
|
|
* ### Key codes.
|
|
* event.keyCode is deprecated, use this reference instead.
|
|
*
|
|
* Handles modifier keys (Shift, Alt, Control) and arrow keys.
|
|
*
|
|
* For alphabetical keys, use the actual character (e.g. 'a') instead of the key code.
|
|
*
|
|
* Something isn't here that you want? Just add it:
|
|
* @url https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values
|
|
* @usage
|
|
* ```ts
|
|
* import { KEY } from 'tgui/common/keys';
|
|
*
|
|
* if (event.key === KEY.Enter) {
|
|
* // do something
|
|
* }
|
|
* ```
|
|
*/
|
|
export enum KEY {
|
|
Alt = 'Alt',
|
|
Backspace = 'Backspace',
|
|
Control = 'Control',
|
|
Delete = 'Delete',
|
|
Down = 'ArrowDown',
|
|
End = 'End',
|
|
Enter = 'Enter',
|
|
Escape = 'Escape',
|
|
Home = 'Home',
|
|
Insert = 'Insert',
|
|
Left = 'ArrowLeft',
|
|
PageDown = 'PageDown',
|
|
PageUp = 'PageUp',
|
|
Right = 'ArrowRight',
|
|
Shift = 'Shift',
|
|
Space = ' ',
|
|
Tab = 'Tab',
|
|
Up = 'ArrowUp',
|
|
}
|