Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions docs/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -425,10 +425,11 @@ Injecting an FF-event into first FF-capable device found

::

from evdev import ecodes, InputDevice, ff
from evdev import ecodes, InputDevice, ff, list_devices
import time

# Find first EV_FF capable event device (that we have permissions to use).
for name in evdev.list_devices():
for name in list_devices():
dev = InputDevice(name)
if ecodes.EV_FF in dev.capabilities():
break
Expand All @@ -446,5 +447,6 @@ Injecting an FF-event into first FF-capable device found

repeat_count = 1
effect_id = dev.upload_effect(effect)
dev.write(e.EV_FF, effect_id, repeat_count)
dev.write(ecodes.EV_FF, effect_id, repeat_count)
time.sleep(duration_ms)
dev.erase_effect(effect_id)