Slide 198
Slide 198 text
198
python-evdev keyboard example
from evdev import UInput, ecodes as e
ui = UInput()
ui.write(e.EV_KEY, e.KEY_H, 1) # KEY_H down
ui.write(e.EV_KEY, e.KEY_H, 0) # KEY_H up
ui.write(e.EV_KEY, e.KEY_E, 1)
ui.write(e.EV_KEY, e.KEY_E, 0)
ui.write(e.EV_KEY, e.KEY_L, 1)
ui.write(e.EV_KEY, e.KEY_L, 0)
ui.write(e.EV_KEY, e.KEY_L, 1)
ui.write(e.EV_KEY, e.KEY_L, 0)
ui.write(e.EV_KEY, e.KEY_O, 1)
ui.write(e.EV_KEY, e.KEY_O, 0)
ui.syn()
●
ui.close()