Skip to content

Instantly share code, notes, and snippets.

@arilotter
Forked from chriskiehl/gist:3287367
Created August 8, 2012 03:23
Show Gist options
  • Save arilotter/3291748 to your computer and use it in GitHub Desktop.
Save arilotter/3291748 to your computer and use it in GitHub Desktop.
import time
import win32api, win32con
def press(x):
win32api.keybd_event(VK_CODE[x], 0,0,0)
win32api.keybd_event(VK_CODE[x],0 ,win32con.KEYEVENTF_KEYUP ,0)
def play():
time.sleep(1)
s = time.time()
while time.time() - s < 15:
press(0x25)
press(0x27)
press(0x25)
press(0x27)
press(0x20)
play()
@arilotter
Copy link
Author

import time
import win32api, win32con

def press(x):
win32api.keybd_event(VK_CODE[x], 0,0,0)
win32api.keybd_event(VK_CODE[x],0 ,win32con.KEYEVENTF_KEYUP ,0)

def play():
time.sleep(1)
s = time.time()
while time.time() - s < 15:
press(0x25)
press(0x27)
press(0x25)
press(0x27)
press(0x20)

play()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment