Skip to content

Instantly share code, notes, and snippets.

View wonkoderverstaendige's full-sized avatar

Ronny Eichler wonkoderverstaendige

  • Radboud University Nijmegen
  • Nijmegen, The Netherlands
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)