-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replaced deprecated keyCode functionality and docs with KeyboardEvent.code & KeyboardEvent.key also updates the keyIsDown function to accept alphanumerics as parameters #7472
Changes from all commits
dd458c0
bcbed0f
c42bb7e
5709aac
0ce4e89
9cfef5a
e0c4a31
ad5ae5b
805a5c9
6d0c0ea
e01add6
e3fc37c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -879,92 +879,104 @@ export const MITER = 'miter'; | |
* @final | ||
*/ | ||
export const AUTO = 'auto'; | ||
|
||
// INPUT | ||
/** | ||
* @typedef {18} ALT | ||
* @typedef {'AltLeft' | 'AltRight'} ALT | ||
* @property {ALT} ALT | ||
* @final | ||
*/ | ||
// INPUT | ||
export const ALT = 18; | ||
export const ALT = 'AltLeft'; | ||
|
||
/** | ||
* @typedef {8} BACKSPACE | ||
* @typedef {'Backspace'} BACKSPACE | ||
* @property {BACKSPACE} BACKSPACE | ||
* @final | ||
*/ | ||
export const BACKSPACE = 8; | ||
export const BACKSPACE = 'Backspace'; | ||
|
||
/** | ||
* @typedef {17} CONTROL | ||
* @typedef {'ControlLeft' | 'ControlRight'} CONTROL | ||
* @property {CONTROL} CONTROL | ||
* @final | ||
*/ | ||
export const CONTROL = 17; | ||
export const CONTROL = 'ControlLeft'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Each constant can only be defined as one thing, so we might need to make two constants instead of a single one There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @davepagurek So, I'm not entirely sure what to do for this. export const CONTROL_CODE = 'Control';
export const CONTROL_KEY = 'ControlLeft'; There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was thinking originally having a const I think this might mean we need to update |
||
|
||
/** | ||
* @typedef {46} DELETE | ||
* @typedef {'Delete'} DELETE | ||
* @property {DELETE} DELETE | ||
* @final | ||
*/ | ||
export const DELETE = 46; | ||
export const DELETE = 'Delete'; | ||
|
||
/** | ||
* @typedef {40} DOWN_ARROW | ||
* @typedef {'ArrowDown'} DOWN_ARROW | ||
* @property {DOWN_ARROW} DOWN_ARROW | ||
* @final | ||
*/ | ||
export const DOWN_ARROW = 40; | ||
export const DOWN_ARROW = 'ArrowDown'; | ||
|
||
/** | ||
* @typedef {13} ENTER | ||
* @typedef {'Enter'} ENTER | ||
* @property {ENTER} ENTER | ||
* @final | ||
*/ | ||
export const ENTER = 13; | ||
export const ENTER = 'Enter'; | ||
|
||
/** | ||
* @typedef {27} ESCAPE | ||
* @typedef {'Escape'} ESCAPE | ||
* @property {ESCAPE} ESCAPE | ||
* @final | ||
*/ | ||
export const ESCAPE = 27; | ||
export const ESCAPE = 'Escape'; | ||
|
||
/** | ||
* @typedef {37} LEFT_ARROW | ||
* @typedef {'ArrowLeft'} LEFT_ARROW | ||
* @property {LEFT_ARROW} LEFT_ARROW | ||
* @final | ||
*/ | ||
export const LEFT_ARROW = 37; | ||
export const LEFT_ARROW = 'ArrowLeft'; | ||
|
||
/** | ||
* @typedef {18} OPTION | ||
* @typedef {'AltLeft' | 'AltRight'} OPTION | ||
* @property {OPTION} OPTION | ||
* @final | ||
*/ | ||
export const OPTION = 18; | ||
export const OPTION = 'AltLeft'; | ||
|
||
/** | ||
* @typedef {13} RETURN | ||
* @typedef {'Enter'} RETURN | ||
* @property {RETURN} RETURN | ||
* @final | ||
*/ | ||
export const RETURN = 13; | ||
export const RETURN = 'Enter'; | ||
|
||
/** | ||
* @typedef {39} RIGHT_ARROW | ||
* @typedef {'ArrowRight'} RIGHT_ARROW | ||
* @property {RIGHT_ARROW} RIGHT_ARROW | ||
* @final | ||
*/ | ||
export const RIGHT_ARROW = 39; | ||
export const RIGHT_ARROW = 'ArrowRight'; | ||
|
||
/** | ||
* @typedef {16} SHIFT | ||
* @typedef {'ShiftLeft' | 'ShiftRight'} SHIFT | ||
* @property {SHIFT} SHIFT | ||
* @final | ||
*/ | ||
export const SHIFT = 16; | ||
export const SHIFT = 'ShiftLeft'; | ||
|
||
/** | ||
* @typedef {9} TAB | ||
* @typedef {'Tab'} TAB | ||
* @property {TAB} TAB | ||
* @final | ||
*/ | ||
export const TAB = 9; | ||
export const TAB = 'Tab'; | ||
|
||
/** | ||
* @typedef {38} UP_ARROW | ||
* @typedef {'ArrowUp'} UP_ARROW | ||
* @property {UP_ARROW} UP_ARROW | ||
* @final | ||
*/ | ||
export const UP_ARROW = 38; | ||
export const UP_ARROW = 'ArrowUp'; | ||
|
||
// RENDERING | ||
/** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why the typedef is both of these while the constant is just one?