From e3ec7e789ac4fe0cccffaafc49e8dfd6193624c9 Mon Sep 17 00:00:00 2001 From: Jeffrey Tan Date: Sun, 29 May 2022 15:17:30 -0700 Subject: [PATCH] added all standard US keys to vkeys.py --- src/common/vkeys.py | 72 +++++++++++++++++++++++++++++---------------- 1 file changed, 46 insertions(+), 26 deletions(-) diff --git a/src/common/vkeys.py b/src/common/vkeys.py index 85e8a6ce..c18620a8 100644 --- a/src/common/vkeys.py +++ b/src/common/vkeys.py @@ -24,22 +24,28 @@ # https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes?redirectedfrom=MSDN KEY_MAP = { - 'tab': 0x09, # Special Keys + 'left': 0x25, # Arrow keys + 'up': 0x26, + 'right': 0x27, + 'down': 0x28, + + 'backspace': 0x08, # Special keys + 'tab': 0x09, + 'enter': 0x0D, + 'shift': 0x10, + 'ctrl': 0x11, 'alt': 0x12, + 'caps lock': 0x14, + 'esc': 0x1B, 'space': 0x20, - 'shift': 0xA0, - 'ctrl': 0x11, - 'del': 0x2E, - 'end': 0x23, 'page up': 0x21, 'page down': 0x22, + 'end': 0x23, + 'home': 0x24, + 'insert': 0x2D, + 'delete': 0x2E, - 'left': 0x25, # Arrow keys - 'up': 0x26, - 'right': 0x27, - 'down': 0x28, - - '0': 0x30, # Numbers + '0': 0x30, # Numbers '1': 0x31, '2': 0x32, '3': 0x33, @@ -50,20 +56,7 @@ '8': 0x38, '9': 0x39, - 'f1': 0x70, # Function keys - 'f2': 0x71, - 'f3': 0x72, - 'f4': 0x73, - 'f5': 0x74, - 'f6': 0x75, - 'f7': 0x76, - 'f8': 0x77, - 'f9': 0x78, - 'f10': 0x79, - 'f11': 0x7A, - 'f12': 0x7B, - - 'a': 0x41, # Letters + 'a': 0x41, # Letters 'b': 0x42, 'c': 0x43, 'd': 0x44, @@ -88,7 +81,34 @@ 'w': 0x57, 'x': 0x58, 'y': 0x59, - 'z': 0x5A + 'z': 0x5A, + + 'f1': 0x70, # Functional keys + 'f2': 0x71, + 'f3': 0x72, + 'f4': 0x73, + 'f5': 0x74, + 'f6': 0x75, + 'f7': 0x76, + 'f8': 0x77, + 'f9': 0x78, + 'f10': 0x79, + 'f11': 0x7A, + 'f12': 0x7B, + 'num lock': 0x90, + 'scroll lock': 0x91, + + ';': 0xBA, # Special characters + '=': 0xBB, + ',': 0xBC, + '-': 0xBD, + '.': 0xBE, + '/': 0xBF, + '`': 0xC0, + '[': 0xDB, + '\\': 0xDC, + ']': 0xDD, + "'": 0xDE }