File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,9 +13,6 @@ def main():
1313 keys .add (uinput .KEY_L )
1414 keys .add (uinput .KEY_O )
1515
16- device .activate ()
17- time .sleep (1 ) # See examples/mouse.py.
18-
1916 keys .click (uinput .KEY_H )
2017 keys .click (uinput .KEY_E )
2118 keys .click (uinput .KEY_L )
Original file line number Diff line number Diff line change @@ -15,25 +15,6 @@ def main():
1515 for rel_axis in (uinput .REL_X , uinput .REL_Y , uinput .REL_WHEEL ):
1616 rel_axes .add (rel_axis )
1717
18- device .activate ()
19- time .sleep (1 )
20- # This magic sleep needs to be taken under X because of the way
21- # how X assigns handlers for new devices:
22-
23- # 1. Kernel creates an evdev device.
24-
25- # 2. A dbus signal "DeviceAdded" is sent.
26-
27- # 3. X's handler assigner catches the dbus event and assigns a
28- # handler for the new device.
29-
30- # Now the "problem" is in the asynchronous nature of this whole
31- # process. Kernel is totally happy once it has created the evdev
32- # device, but X cannot assign a handler for the new device before
33- # it receives the dbus signal. Without this delay, kernel would
34- # generate events before a handler is assigned. Perhaps a better
35- # way would be to listen to the dbus inside the library?
36-
3718 for i in range (20 ):
3819 rel_axes .move_by (uinput .REL_X , 5 , False )
3920 rel_axes .move_by (uinput .REL_Y , 5 )
You can’t perform that action at this time.
0 commit comments