sezanzeb / input-remapper

🎮 ⌨ An easy to use tool to change the behaviour of your input devices.
GNU General Public License v3.0
3.72k stars 153 forks source link

using ID_INPUT_* attributes of devices #192

Open sezanzeb opened 2 years ago

sezanzeb commented 2 years ago

static bool test_pointers https://github.com/systemd/systemd/blob/42ffc40ce382dfda5f2a100698673bc252a72194/src/udev/udev-builtin-input_id.c#L148

  1. the classify function of key-mapper does something similar to this, are both delivering similar results?
  2. are the forward_to devices compliant with this function, so that a "... forwarded" device created from a touchpad still classifies as a touchpad for systemd?

This might have a slim chance of finding the bug of https://github.com/sezanzeb/key-mapper/issues/36 and https://github.com/sezanzeb/key-mapper/issues/185

It could be added as a key-mapper-control --command get-type command, either by using python-evdev or c bindings, which can then be used to test the ... fowarded devices

sezanzeb commented 2 years ago

https://github.com/pyudev/pyudev might be able to access the attributes ID_INPUT_TABLET and such, replacing classify and making it possible to write some debug log for all created uinputs, to test if they are classified correctly during runtime.

pyudev is available in the arch repos, in ubuntu 21.04 https://packages.ubuntu.com/hirsute/python3-pyudev and pip https://pyudev.readthedocs.io/en/latest/install.html

TODO: test if it works on all common linux distros reliably, or if it definitely requires systemd (since the snipped I found is in the systemd repo). If so, then it might still be possible to add it to key-mapper as an optional dependency, adding some log if pyudev is able to read the attribute at all.

ECO1AI commented 1 month ago

i just would like to note something in regards to #36

in the past, both stylus and mouse uses the same cursor. back then i was able to map right click to one stylus button without any issues. but at some point it changed: now both mouse and stylus uses different cursors . So, when right click is mapped mouse cursor and button is clicked: right click activates mouse cursor and overwrites stylus cursor then system is waiting for mouse to move, unless stylus is no longer hovering (no longer detected) on the screen which resets the action.

still investigating from where did this change come (wacom driver, kernel, IPTS driver, or kde)