Skip to content

Instantly share code, notes, and snippets.

View mackenzie-gray's full-sized avatar
:shipit:
Ship it

Mack Gray mackenzie-gray

:shipit:
Ship it
View GitHub Profile
import time
import win32api, win32con
VK_CODE = {'left_arrow':0x25,
'spacebar':0x20,
'right_arrow':0x27}
def press(x):
win32api.keybd_event(VK_CODE[x], 0,0,0)
win32api.keybd_event(VK_CODE[x],0 ,win32con.KEYEVENTF_KEYUP ,0)