Skip to content

Instantly share code, notes, and snippets.

@nk521
Created February 2, 2020 13:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nk521/480c9d1d12bae1afc6f6b0f9fde797e3 to your computer and use it in GitHub Desktop.
Save nk521/480c9d1d12bae1afc6f6b0f9fde797e3 to your computer and use it in GitHub Desktop.
command_dispatcher = {'A': Keycode.A,
'B': Keycode.B,
'C': Keycode.C,
'D': Keycode.D,
'E': Keycode.E,
'F': Keycode.F,
'G': Keycode.G,
'H': Keycode.H,
'I': Keycode.I,
'J': Keycode.J,
'K': Keycode.K,
'L': Keycode.L,
'M': Keycode.M,
'N': Keycode.N,
'O': Keycode.O,
'P': Keycode.P,
'Q': Keycode.Q,
'R': Keycode.R,
'S': Keycode.S,
'T': Keycode.T,
'U': Keycode.U,
'V': Keycode.V,
'W': Keycode.W,
'X': Keycode.X,
'Y': Keycode.Y,
'Z': Keycode.Z,
'n1': Keycode.ONE,
'n2': Keycode.TWO,
'n3': Keycode.THREE,
'n4': Keycode.FOUR,
'n5': Keycode.FIVE,
'n6': Keycode.SIX,
'n7': Keycode.SEVEN,
'n8': Keycode.EIGHT,
'n9': Keycode.NINE,
'n0': Keycode.ZERO,
'ENTER': Keycode.ENTER,
'RETURN': Keycode.RETURN,
'ESCAPE': Keycode.ESCAPE,
'BACKSPACE': Keycode.BACKSPACE,
'TAB': Keycode.TAB,
'SPACE': Keycode.SPACEBAR,
'n-': Keycode.MINUS,
'n=': Keycode.EQUALS,
'n(': Keycode.LEFT_BRACKET,
'n)': Keycode.RIGHT_BRACKET,
'n\\': Keycode.BACKSLASH,
'n#': Keycode.POUND,
'n;': Keycode.SEMICOLON,
'QUOTE': Keycode.QUOTE,
'n`': Keycode.GRAVE_ACCENT,
'n,': Keycode.COMMA,
'n.': Keycode.PERIOD,
'n/': Keycode.FORWARD_SLASH,
'CAPS_LOCK': Keycode.CAPS_LOCK,
'F1': Keycode.F1,
'F2': Keycode.F2,
'F3': Keycode.F3,
'F4': Keycode.F4,
'F5': Keycode.F5,
'F6': Keycode.F6,
'F7': Keycode.F7,
'F8': Keycode.F8,
'F9': Keycode.F9,
'F10': Keycode.F10,
'F11': Keycode.F11,
'F12': Keycode.F12,
'PS': Keycode.PRINT_SCREEN,
'SCROLL_LOCK': Keycode.SCROLL_LOCK,
'PAUSE': Keycode.PAUSE,
'INSERT': Keycode.INSERT,
'HOME': Keycode.HOME,
'PAGE_UP': Keycode.PAGE_UP,
'DELETE': Keycode.DELETE,
'END': Keycode.END,
'PAGE_DOWN': Keycode.PAGE_DOWN,
'RIGHT': Keycode.RIGHT_ARROW,
'LEFT': Keycode.LEFT_ARROW,
'DOWN': Keycode.DOWN_ARROW,
'n*': Keycode.KEYPAD_ASTERISK,
'n+': Keycode.KEYPAD_PLUS,
'CONTROL': Keycode.CONTROL,
'SHIFT': Keycode.SHIFT,
'ALT': Keycode.ALT,
'OPTION': Keycode.OPTION,
'META': Keycode.GUI,
'WINDOWS': Keycode.WINDOWS,
'COMMAND': Keycode.COMMAND,
'RIGHT_CONTROL': Keycode.RIGHT_CONTROL,
'RIGHT_SHIFT': Keycode.RIGHT_SHIFT,
'RIGHT_ALT': Keycode.RIGHT_ALT,
'UP': Keycode.UP_ARROW,
'NUMLOCK': Keycode.KEYPAD_NUMLOCK,
'MENU': Keycode.APPLICATION,
'POWER': Keycode.POWER
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment