Use Keyboard Key variables instead of hardcoded strings

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2019-10-09 19:59:11 +01:00
parent 84e71297ef
commit 58317b1608
9 changed files with 51 additions and 30 deletions

View file

@ -63,15 +63,29 @@ export const KeyCode = {
export const Key = {
HOME: "Home",
End: "End",
END: "End",
PAGE_UP: "PageUp",
PAGE_DOWN: "PageDown",
BACKSPACE: "Backspace",
ARROW_UP: "ArrowUp",
ARROW_DOWN: "ArrowDown",
TAB: "Tab",
ESCAPE: "Escape",
ENTER: "Enter",
ALT: "Alt",
CONTROL: "Control",
META: "Meta",
SHIFT: "Shift",
LESS_THAN: "<",
GREATER_THAN: ">",
BACKTICK: "`",
SPACE: " ",
ENTER: "Enter",
B: "b",
I: "i",
K: "k",
Y: "y",
Z: "z",
};
export function isOnlyCtrlOrCmdKeyEvent(ev) {