input-remapper
input-remapper copied to clipboard
Map REL_X/Y to wheel events
Hello, all!
TL;DR: Trying to map a key to use as a latop's middle mouse for trackball scrolling. I fail to understand why the mapping fails.
Backstory: I'm using a similar Perixx funky USB keyboard with a trackball instead of a touchpad and want to map F2 for scrolling, similar to scrolling while pressing middle button and moving trackpoint. The trackball input device has a "BTN_MIDDLE" event code but doesn't get registered when mapped to a keyboard button.
Do I need to set the F2 to some other events?
-
input-remapper 1.4.2 1c7a6aaa9e42a646859812a8ec99beb902e9bb3e https://github.com/sezanzeb/input-remapper python-evdev 1.5.0
- Debian 11
- Wayland
- Gnome
-
lrwxrwxrwx 1 root root 0 apr 24 08:52 /proc/1/exe -> /usr/lib/systemd/systemd
- Presets 6.1.
$ cat .config/input-remapper/presets/HID\ 1ddd\:1130/F2\ to\ scroll.json
{
"mapping": {
"1,60,1": [
"h(BTN_MIDDLE)",
"mouse"
]
}
}
6.2.
$ cat .config/input-remapper/presets/DELL0918\:00\ 0488\:121F\ Mouse/middle.json
{
"mapping": {
"1,274,1": [
"if_eq($bar, 1, h(BTN_MIDDLE)).set(bar, 0)",
"mouse"
]
}
}
Event: time 1650875064.954514, type 1 (EV_KEY), code 60 (KEY_F2), value 2
Event: time 1650875064.954514, -------------- SYN_REPORT ------------
instead of h(BTN_MIDDLE)
you can just write BTN_MIDDLE
if_eq($bar, 1, h(BTN_MIDDLE)).set(bar, 0)
why are you using a variable here?
Thanks for the h(tip)
!
Reason for using a variable was because I misunderstood the Combination spanning multiple devices.
OK, even if there's only BTN_MIDDLE
, unfortunately no scrolling motion happens and only the text is pasted from mouse clipboard buffer.
Wondering, if there's a way to translate the trackball movement events (1) to REL_WHEEL
events (2) when a keyboard button is pressed? In other words, for the trackball to act as a scroll-ball with a keyboard button press.
(1) Trackball events
Event: time 1651220603.086950, type 2 (EV_REL), code 1 (REL_Y), value 2
Event: time 1651220603.086950, -------------- SYN_REPORT ------------
Event: time 1651220603.094960, type 2 (EV_REL), code 0 (REL_X), value -4
Event: time 1651220603.094960, type 2 (EV_REL), code 1 (REL_Y), value 1
Event: time 1651220603.094960, -------------- SYN_REPORT ------------
(2) REL_WHEEL
events from Logitech MX Master 2S wheels (vertical and horizontal)
Event: time 1651220513.402308, type 2 (EV_REL), code 12 (REL_HWHEEL_HI_RES), value -120
Event: time 1651220513.402308, -------------- SYN_REPORT ------------
Event: time 1651220514.482213, type 2 (EV_REL), code 6 (REL_HWHEEL), value -1
Event: time 1651220514.482213, type 2 (EV_REL), code 12 (REL_HWHEEL_HI_RES), value -120
Event: time 1651220514.482213, -------------- SYN_REPORT ------------
Event: time 1651220516.402207, type 2 (EV_REL), code 8 (REL_WHEEL), value -1
Event: time 1651220516.402207, type 2 (EV_REL), code 11 (REL_WHEEL_HI_RES), value -120
Event: time 1651220516.402207, -------------- SYN_REPORT ------------
Event: time 1651220516.814301, type 2 (EV_REL), code 8 (REL_WHEEL), value 1
Event: time 1651220516.814301, type 2 (EV_REL), code 11 (REL_WHEEL_HI_RES), value 120
Not right now.
Maybe at some point after @jonasBoss changes we will add a handler that maps mouse movements to wheel events
The groundwork for this is done and on the beta
branch. A RelToRelHandler
should be very similar to the already Implemented AbsToRelHandler
. So if anyone wants to implement it, that would be a good starting point.