Guest User

Untitled

a guest
Jun 24th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #!/usr/bin/env python
  2. from Xlib.display import Display
  3. from Xlib import X
  4. from Xlib.protocol import event
  5. import time
  6.  
  7. display = Display()
  8. focus = display.get_input_focus().focus
  9.  
  10. keycode = 1
  11. state = 0
  12.  
  13. keyevt = event.KeyPress(
  14. detail=keycode,
  15. time=X.CurrentTime,
  16. root=display.screen().root,
  17. window=focus,
  18. child=X.NONE,
  19. root_x=1,
  20. root_y=1,
  21. event_x=1,
  22. event_y=1,
  23. state=state,
  24. same_screen=1
  25. )
  26. focus.send_event(keyevt)
Add Comment
Please, Sign In to add comment