Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- from Xlib.display import Display
- from Xlib import X
- from Xlib.protocol import event
- import time
- display = Display()
- focus = display.get_input_focus().focus
- keycode = 1
- state = 0
- keyevt = event.KeyPress(
- detail=keycode,
- time=X.CurrentTime,
- root=display.screen().root,
- window=focus,
- child=X.NONE,
- root_x=1,
- root_y=1,
- event_x=1,
- event_y=1,
- state=state,
- same_screen=1
- )
- focus.send_event(keyevt)
Add Comment
Please, Sign In to add comment