Skip to content

Commit

Permalink
added all standard US keys to vkeys.py
Browse files Browse the repository at this point in the history
  • Loading branch information
tanjeffreyz committed May 29, 2022
1 parent 146998d commit e3ec7e7
Showing 1 changed file with 46 additions and 26 deletions.
72 changes: 46 additions & 26 deletions src/common/vkeys.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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
}


Expand Down

0 comments on commit e3ec7e7

Please sign in to comment.