-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Description
EventCodeIterator skips some event codes. One example of this is the Thrustmaster Solaris Base, which has EV_KEY 300, 301, and 302 as keys.
evtest output:
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x44f product 0x422 version 0x111
Input device name: "Thrustmaster Solaris Base"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
... (snipped)
Event code 298 (BTN_BASE5)
Event code 299 (BTN_BASE6)
Event code 300 (?)
Event code 301 (?)
Event code 302 (?)
Event code 303 (BTN_DEAD)
Event code 704 (BTN_TRIGGER_HAPPY1)
Event code 705 (BTN_TRIGGER_HAPPY2)
... (snipped)
It's not possible to use EventCodeIterator to find these supported codes, which are mapped to real physical buttons.
If I try to store the supported event codes in a file to later create a virtual device to replay inputs I will inadvertently created a different device with missing event codes.
This is caused by int_to_ev_key returning None for unknown codes. It's possible to ignore the iterator and manually scan for these codes by constructing an EV_UNK that has type = 1 and code = 300 and passing that to has_event_code.
Metadata
Metadata
Assignees
Labels
No labels