Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. from pynput.keyboard import Key, Controller
  2. import time
  3. keyboard = Controller()
  4. data = list(input("type in the thing you want to say"))
  5.  
  6.  
  7. def keystroke():
  8. for temp in data:
  9. if temp.islower():
  10. keyboard.press(temp)
  11. keyboard.release(temp)
  12. time.sleep(0.03)
  13. else:
  14. with keyboard.pressed(Key.shift):
  15. keyboard.press(temp.lower())
  16. keyboard.release(temp.lower())
  17.  
  18.  
  19. keystroke()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement