Skip to content

Commit

Permalink
more keys
Browse files Browse the repository at this point in the history
  • Loading branch information
arpruss committed Jun 15, 2017
1 parent e563954 commit 43593fd
Showing 1 changed file with 48 additions and 1 deletion.
49 changes: 48 additions & 1 deletion mcpipy/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,54 @@
MEDIA_PLAY_PAUSE = 0xB3
BROWSER_BACK = 0xA6
BROWSER_FORWARD = 0xA7

KEY_0 = 0x30
KEY_1 = 0x31
KEY_2 = 0x32
KEY_3 = 0x33
KEY_4 = 0x34
KEY_5 = 0x35
KEY_6 = 0x36
KEY_7 = 0x37
KEY_8 = 0x38
KEY_9 = 0x39
KEY_A = 0x41
KEY_B = 0x42
KEY_C = 0x43
KEY_D = 0x44
KEY_E = 0x45
KEY_F = 0x46
KEY_G = 0x47
KEY_H = 0x48
KEY_I = 0x49
KEY_J = 0x4A
KEY_K = 0x4B
KEY_L = 0x4C
KEY_M = 0x4D
KEY_N = 0x4E
KEY_O = 0x4F
KEY_P = 0x50
KEY_Q = 0x51
KEY_R = 0x52
KEY_S = 0x53
KEY_T = 0x54
KEY_U = 0x55
KEY_V = 0x56
KEY_W = 0x57
KEY_X = 0x58
KEY_Y = 0x59
KEY_Z = 0x5A
KEY_SEMICOLON = 0xBA
KEY_PLUS = 0xBB
KEY_COMMA = 0xBC
KEY_MINUS = 0xBD
KEY_PERIOD = 0xBE
KEY_SLASH = 0xBF
KEY_BACKQUOTE = 0xC0
KEY_OPEN_BRACKET = 0xDB
KEY_BACKSLASH = 0xDC
KEY_CLOSE_BRACKET = 0xDD
KEY_APOSTROPHE = 0xDE

def getPressState(key):
v = windll.user32.GetAsyncKeyState(int(key))
return bool(0x8000 & v), bool(0x0001 & v)
Expand Down

0 comments on commit 43593fd

Please sign in to comment.