sezanzeb / input-remapper

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

Button hold event does not get transmitted or generated #328

Open fiveHourNap opened 2 years ago

fiveHourNap commented 2 years ago

issue description

I have a trackball and the gsetting for scroll wheel emulation only works if the input-remapper is not forwarding the device.

Expected behaviour on pressing and holding the button: moving the physical ball scrolls instead of moving the cursor

Observed behaviour: moving the ball moves the cursor


system info

OS: Linux Manjaro 21.2.4
Kernel: 5.15.25
DE: GNOME 41.4 WM: Mutter 41.4 Device of concern: ELECOM TrackBall Mouse HUGE TrackBall


known information

without forwarding:

Event: time 1646247325.910676, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90008
Event: time 1646247325.910676, type 1 (EV_KEY), code 279 (BTN_TASK), value 1
Event: time 1646247325.910676, -------------- SYN_REPORT ------------
Event: time 1646247326.172769, type 1 (EV_KEY), code 279 (BTN_TASK), value 2
Event: time 1646247326.172769, -------------- SYN_REPORT ------------
Event: time 1646247326.212768, type 1 (EV_KEY), code 279 (BTN_TASK), value 2
Event: time 1646247326.212768, -------------- SYN_REPORT ------------
Event: time 1646247326.249641, type 1 (EV_KEY), code 279 (BTN_TASK), value 2
Event: time 1646247326.249641, -------------- SYN_REPORT ------------
Event: time 1646247326.286105, type 1 (EV_KEY), code 279 (BTN_TASK), value 2
Event: time 1646247326.286105, -------------- SYN_REPORT ------------
Event: time 1646247326.322769, type 1 (EV_KEY), code 279 (BTN_TASK), value 2
Event: time 1646247326.322769, -------------- SYN_REPORT ------------
Event: time 1646247326.362784, type 1 (EV_KEY), code 279 (BTN_TASK), value 2
Event: time 1646247326.362784, -------------- SYN_REPORT ------------
Event: time 1646247326.399437, type 1 (EV_KEY), code 279 (BTN_TASK), value 2
Event: time 1646247326.399437, -------------- SYN_REPORT ------------
Event: time 1646247326.436094, type 1 (EV_KEY), code 279 (BTN_TASK), value 2
Event: time 1646247326.436094, -------------- SYN_REPORT ------------
Event: time 1646247326.472770, type 1 (EV_KEY), code 279 (BTN_TASK), value 2
Event: time 1646247326.472770, -------------- SYN_REPORT ------------
Event: time 1646247326.509612, type 1 (EV_KEY), code 279 (BTN_TASK), value 2
Event: time 1646247326.509612, -------------- SYN_REPORT ------------
Event: time 1646247326.549436, type 1 (EV_KEY), code 279 (BTN_TASK), value 2
Event: time 1646247326.549436, -------------- SYN_REPORT ------------
Event: time 1646247326.589649, type 1 (EV_KEY), code 279 (BTN_TASK), value 2
Event: time 1646247326.589649, -------------- SYN_REPORT ------------
Event: time 1646247326.589649, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90008
Event: time 1646247326.589649, type 1 (EV_KEY), code 279 (BTN_TASK), value 0
Event: time 1646247326.589649, -------------- SYN_REPORT ------------

with forwarding on but no rule set:

Event: time 1646241346.523622, -------------- SYN_REPORT ------------
Event: time 1646241347.050689, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90008
Event: time 1646241347.050689, type 1 (EV_KEY), code 279 (BTN_TASK), value 1
Event: time 1646241347.050689, -------------- SYN_REPORT ------------
Event: time 1646241347.172708, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90008
Event: time 1646241347.172708, type 1 (EV_KEY), code 279 (BTN_TASK), value 0

with forwarding on and hold(BTN_TASK) bound on the button:

Event: time 1646247886.010888, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90008
Event: time 1646247886.010888, -------------- SYN_REPORT ------------
Event: time 1646247888.406274, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90008
Event: time 1646247888.406274, -------------- SYN_REPORT ------------

with forwarding on and hold(event(EV_KEY, BTN_TASK, 2)) bound on the button:

Event: time 1646248405.741414, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90008
Event: time 1646248405.741414, -------------- SYN_REPORT ------------
Event: time 1646248407.499629, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90008
Event: time 1646248407.499629, -------------- SYN_REPORT ------------
Device:           ELECOM TrackBall Mouse HUGE TrackBall
Kernel:           /dev/input/event20
Group:            3
Seat:             seat0, default
Capabilities:     keyboard pointer 
Tap-to-click:     n/a
Tap-and-drag:     n/a
Tap drag lock:    n/a
Left-handed:      disabled
Nat.scrolling:    disabled
Middle emulation: disabled
Calibration:      n/a
Scroll methods:   button
Click methods:    none
Disable-w-typing: n/a
Accel profiles:   flat *adaptive
Rotation:         0.0
Device:           input-remapper ELECOM TrackBall Mouse HUGE TrackBall forwarded
Kernel:           /dev/input/event27
Group:            3
Seat:             seat0, default
Capabilities:     keyboard pointer 
Tap-to-click:     n/a
Tap-and-drag:     n/a
Tap drag lock:    n/a
Left-handed:      disabled
Nat.scrolling:    disabled
Middle emulation: disabled
Calibration:      n/a
Scroll methods:   button
Click methods:    none
Disable-w-typing: n/a
Accel profiles:   flat *adaptive
Rotation:         n/a
P: /devices/pci0000:00/0000:00:01.3/0000:03:00.0/usb1/1-9/1-9:1.0/0003:056E:010C.001D/input/input100/event20
N: input/event20
L: 0
S: input/by-path/pci-0000:03:00.0-usb-0:9:1.0-event-mouse
S: input/by-id/usb-ELECOM_TrackBall_Mouse_HUGE_TrackBall-event-mouse
E: DEVPATH=/devices/pci0000:00/0000:00:01.3/0000:03:00.0/usb1/1-9/1-9:1.0/0003:056E:010C.001D/input/input100/event20
E: DEVNAME=/dev/input/event20
E: MAJOR=13
E: MINOR=84
E: SUBSYSTEM=input
E: USEC_INITIALIZED=28725272394
E: ID_INPUT=1
E: ID_INPUT_MOUSE=1
E: ID_INPUT_KEY=1
E: ID_VENDOR=ELECOM_TrackBall_Mouse
E: ID_VENDOR_ENC=ELECOM\x20TrackBall\x20Mouse
E: ID_VENDOR_ID=056e
E: ID_MODEL=HUGE_TrackBall
E: ID_MODEL_ENC=HUGE\x20TrackBall
E: ID_MODEL_ID=010c
E: ID_REVISION=0110
E: ID_SERIAL=ELECOM_TrackBall_Mouse_HUGE_TrackBall
E: ID_TYPE=hid
E: ID_BUS=usb
E: ID_USB_INTERFACES=:030102:
E: ID_USB_INTERFACE_NUM=00
E: ID_USB_DRIVER=usbhid
E: ID_PATH=pci-0000:03:00.0-usb-0:9:1.0
E: ID_PATH_TAG=pci-0000_03_00_0-usb-0_9_1_0
E: ID_INPUT_TRACKBALL=1
E: LIBINPUT_DEVICE_GROUP=3/56e/10c:usb-0000:03:00.0-9
E: DEVLINKS=/dev/input/by-path/pci-0000:03:00.0-usb-0:9:1.0-event-mouse /dev/input/by-id/usb-ELECOM_TrackBall_Mouse_HUGE_TrackBall-event-mouse
E: TAGS=:power-switch:
E: CURRENT_TAGS=:power-switch:
P: /devices/pci0000:00/0000:00:01.3/0000:03:00.0/usb1/1-9/1-9:1.0/0003:056E:010C.001D/input/input100/event20
N: input/event20
L: 0
S: input/by-id/usb-ELECOM_TrackBall_Mouse_HUGE_TrackBall-event-mouse
S: input/by-path/pci-0000:03:00.0-usb-0:9:1.0-event-mouse
E: DEVPATH=/devices/pci0000:00/0000:00:01.3/0000:03:00.0/usb1/1-9/1-9:1.0/0003:056E:010C.001D/input/input100/event20
E: DEVNAME=/dev/input/event20
E: MAJOR=13
E: MINOR=84
E: SUBSYSTEM=input
E: USEC_INITIALIZED=28725272394
E: ID_INPUT=1
E: ID_INPUT_MOUSE=1
E: ID_INPUT_KEY=1
E: ID_VENDOR=ELECOM_TrackBall_Mouse
E: ID_VENDOR_ENC=ELECOM\x20TrackBall\x20Mouse
E: ID_VENDOR_ID=056e
E: ID_MODEL=HUGE_TrackBall
E: ID_MODEL_ENC=HUGE\x20TrackBall
E: ID_MODEL_ID=010c
E: ID_REVISION=0110
E: ID_SERIAL=ELECOM_TrackBall_Mouse_HUGE_TrackBall
E: ID_TYPE=hid
E: ID_BUS=usb
E: ID_USB_INTERFACES=:030102:
E: ID_USB_INTERFACE_NUM=00
E: ID_USB_DRIVER=usbhid
E: ID_PATH=pci-0000:03:00.0-usb-0:9:1.0
E: ID_PATH_TAG=pci-0000_03_00_0-usb-0_9_1_0
E: ID_INPUT_TRACKBALL=1
E: LIBINPUT_DEVICE_GROUP=3/56e/10c:usb-0000:03:00.0-9
E: DEVLINKS=/dev/input/by-id/usb-ELECOM_TrackBall_Mouse_HUGE_TrackBall-event-mouse /dev/input/by-path/pci-0000:03:00.0-usb-0:9:1.0-event-mouse
E: TAGS=:power-switch:
E: CURRENT_TAGS=:power-switch:

I initially thought that this is related to #185, which is why I included all this info. But a deeper dig revealed that this is related to the transmission of the hold value. Which, according to the comments in the code is not being forwarded. But the event is not being generated on its own, so I think a transmission is necessary.

sezanzeb commented 2 years ago

Quoting https://github.com/sezanzeb/input-remapper/issues/49#issuecomment-831622386:

X/Wayland do their own key repeat, the kernel key repeats are filtered in libinput and would only affect a VT

I really wish there was someone who really knows GNOME internals who contributes to this project. There are so many problems with environments that I just don't understand at all.