Exclude Joystick Buttons from Default UInput Capabilities?
UInput capabilities default to `{ecodes.EV_KEY: ecodes.keys.keys()}`. This contains some joystick buttons that *conflict* with mouse buttons -- users have to explictly declare capabilities like `{ecodes.EV_KEY: [ecodes.BTN_LEFT, ecodes.BTN_RIGHT]}` to simulate mouse clicks.
I tested all codes in `ecodes.keys` one by one with capability `{ecodes.EV_KEY: [ecodes.BTN_LEFT, code_to_test_for_mouse_button_conflict]}`. Found conflicts: 288 - 318, 544 - 547, 704 - 743, in hexadecimal 0x120 - 0x13e, 0x220 - 0x223, 0x2c0 - 2x2e7.
* Linux key codes reference: [input-event-codes.h](https://github.com/torvalds/linux/blob/master/include/uapi/linux/input-event-codes.h)
Since keyboard and mouse simulation is more prevalent than joystick. I suggest to exclude joystick button codes from UInput default.
0 条评论