SHARE
TWEET

Untitled

a guest Aug 7th, 2012 756 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import time
  2. import pyatspi
  3.  
  4. VK_CODE = {'left_arrow':113,
  5.            'right_arrow':114,
  6.            'spacebar':65 }
  7.  
  8. def press(x):
  9.     pyatspi.Registry.generateKeyboardEvent(VK_CODE[x], None,
  10.                                           pyatspi.KEY_PRESSRELEASE)
  11.  
  12. def play():
  13.         time.sleep(1)
  14.         s = time.time()
  15.         while time.time() - s < 15:
  16.                 press("left_arrow")
  17.                 press("right_arrow")
  18.                 press("left_arrow")
  19.                 press("right_arrow")
  20. # faster without this
  21. #               press('spacebar')  
  22.  
  23. play()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top