Advertisement
asweigart

PyAutoGUI Keyboard Test

Jul 21st, 2019
406
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.68 KB | None | 0 0
  1. import pyautogui
  2. import time
  3. print('Have a text editor open and in focus.')
  4. print('Program starts in 5 seconds...')
  5. time.sleep(5)
  6. pyautogui.typewrite(r"""`1234567890-=qwertyuiop[]\asdfghjkl;'zxcvbnm,./""")
  7. pyautogui.keyDown('shift')
  8. pyautogui.typewrite(r"""`1234567890-=qwertyuiop[]\asdfghjkl;'zxcvbnm,./""")
  9. pyautogui.keyUp('shift')
  10. """
  11. Please copy and paste the text that this progam produces, along with your
  12. keyboard type ("azerty", "qwertz", etc.) and your operating system and
  13. operating system version to al@inventwithpython.com
  14.  
  15. On a qwerty keyboard, this produces the text:
  16. `1234567890-=qwertyuiop[]\asdfghjkl;'zxcvbnm,./~!@#$%^&*()_+QWERTYUIOP{}|ASDFGHJKL:"ZXCVBNM<>?
  17. """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement