From f6154dc0af1a0d65819e87240f4385f9573095cb Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 30 Jan 2020 04:37:25 +0900 Subject: v12 (#5712) Co-authored-by: MeiMei <30769358+mei23@users.noreply.github.com> Co-authored-by: Satsuki Yanagi <17376330+u1-liquid@users.noreply.github.com> --- src/client/app/common/keycode.ts | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 src/client/app/common/keycode.ts (limited to 'src/client/app/common/keycode.ts') diff --git a/src/client/app/common/keycode.ts b/src/client/app/common/keycode.ts deleted file mode 100644 index 5786c1dc0a..0000000000 --- a/src/client/app/common/keycode.ts +++ /dev/null @@ -1,33 +0,0 @@ -export default (input: string): string[] => { - if (Object.keys(aliases).some(a => a.toLowerCase() == input.toLowerCase())) { - const codes = aliases[input]; - return Array.isArray(codes) ? codes : [codes]; - } else { - return [input]; - } -}; - -export const aliases = { - 'esc': 'Escape', - 'enter': ['Enter', 'NumpadEnter'], - 'up': 'ArrowUp', - 'down': 'ArrowDown', - 'left': 'ArrowLeft', - 'right': 'ArrowRight', - 'plus': ['NumpadAdd', 'Semicolon'], -}; - -/*! -* Programatically add the following -*/ - -// lower case chars -for (let i = 97; i < 123; i++) { - const char = String.fromCharCode(i); - aliases[char] = `Key${char.toUpperCase()}`; -} - -// numbers -for (let i = 0; i < 10; i++) { - aliases[i] = [`Numpad${i}`, `Digit${i}`]; -} -- cgit v1.2.3-freya