sezanzeb / input-remapper

๐ŸŽฎ โŒจ An easy to use tool to change the behaviour of your input devices.
GNU General Public License v3.0
3.9k stars 162 forks source link

On chromium/electron based apps, injections doesn't work as expected #325

Open Inky1003 opened 2 years ago

Inky1003 commented 2 years ago

Summary:

They work-ish. Basically they work but the old events are still sent to chromium/electron based apps like Discord, Vivaldi, etc. This don't let me scroll some pages because It sends the "go back" and "go forward" commands, even with the injection.

Share some logs please:

  1. input-remapper-control --version

    input-remapper 1.4.1 180bf5aa418e773923865d62c4c1b37c3865506f https://github.com/sezanzeb/input-remapper
    python-evdev 1.4.0
  2. which linux distro (ubuntu 20.04, manjaro, etc.) Manjaro

  3. echo $XDG_SESSION_TYPE x11

  4. which desktop environment (gnome, plasma, xfce4, etc.) KDE Plasma 5.24

  5. sudo ls -l /proc/1/exe lrwxrwxrwx 1 root root 0 mar 1 09:45 /proc/1/exe -> /usr/lib/systemd/systemd

  6. paste the affected preset .json file from ~/.config/input-remapper/presets marcia.zip

  7. sudo pkill -f input-remapper-service && input-remapper-gtk -d, start the injection and hit your key. Then share that log.

    11:16:14.603357 69253 GUI INFO logger.py:228: input-remapper-gtk 1.4.1 180bf5aa418e773923865d62c4c1b37c3865506f https://github.com/sezanzeb/input-remapper
    11:16:14.603437 69253 GUI INFO logger.py:236: python-evdev 1.4.0
    11:16:14.603491 69253 GUI WARNING logger.py:239: Debug level will log all your keystrokes! Do not post this output in the internet if you typed in sensitive or private information with your device!
    11:16:14.603532 69253 GUI DEBUG input-remapper-gtk:55: Using locale directory: /usr/share/input-remapper/lang
    11:16:14.606908 69253 GUI DEBUG pipe.py:62: Creating new pipe for "/tmp/input-remapper-inky/results"
    11:16:14.608245 69253 GUI DEBUG pipe.py:62: Creating new pipe for "/tmp/input-remapper-inky/commands"
    11:16:14.616282 69253 GUI INFO global_config.py:105: Loaded config from "/home/inky/.config/input-remapper/config.json"
    11:16:14.617872 69253 GUI INFO daemon.py:207: Starting the service
    11:16:14.617939 69253 GUI DEBUG daemon.py:218: Running `pkexec input-remapper-control --command start-daemon  -d`
    11:16:17.535630 69262 Control INFO logger.py:292: Starting logging to "/var/log/input-remapper-control"
    11:16:17.535740 69262 Control DEBUG input-remapper-control:206: Call for "['/usr/bin/input-remapper-control', '--command', 'start-daemon', '-d']"
    11:16:17.542775 69262 Control INFO input-remapper-control:236: Done
    11:16:17.753989 69278 Service INFO logger.py:292: Starting logging to "/var/log/input-remapper"
    11:16:17.754096 69278 Service DEBUG daemon.py:166: Creating daemon
    11:16:17.754229 69278 Service INFO global_config.py:105: Loaded config from "/home/inky/.config/input-remapper/config.json"
    11:16:17.754312 69278 Service DEBUG shared_dict.py:57: Starting SharedDict process
    11:16:17.755538 69278 Service DEBUG global_uinputs.py:49: creating UInput device: 'input-remapper keyboard'
    11:16:17.755947 69279 Service DEBUG shared_dict.py:63: SharedDict process started
    11:16:17.763491 69253 GUI DEBUG daemon.py:228: Attempt 1 to reach the service failed:
    11:16:17.763570 69253 GUI DEBUG daemon.py:229: "g-dbus-error-quark: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name inputremapper.Control was not provided by any .service files (2)"
    11:16:17.857454 69278 Service DEBUG global_uinputs.py:49: creating UInput device: 'input-remapper gamepad'
    11:16:17.958311 69278 Service DEBUG global_uinputs.py:49: creating UInput device: 'input-remapper mouse'
    11:16:17.964488 69253 GUI DEBUG daemon.py:228: Attempt 2 to reach the service failed:
    11:16:17.964570 69253 GUI DEBUG daemon.py:229: "g-dbus-error-quark: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name inputremapper.Control was not provided by any .service files (2)"
    11:16:18.064220 69278 Service DEBUG daemon.py:254: Running daemon
    11:16:18.165971 69253 GUI DEBUG daemon.py:237: Telling service about "/home/inky/.config/input-remapper"
    11:16:18.166957 69278 Service INFO global_config.py:105: Loaded config from "/home/inky/.config/input-remapper/config.json"
    11:16:18.167341 69253 GUI DEBUG user_interface.py:245: Running `pkexec input-remapper-control --command helper  -d`
    11:16:18.404658 69294 Control INFO logger.py:292: Starting logging to "/var/log/input-remapper-control"
    11:16:18.404774 69294 Control DEBUG input-remapper-control:206: Call for "['/usr/bin/input-remapper-control', '--command', 'helper', '-d']"
    11:16:18.412981 69294 Control INFO input-remapper-control:236: Done
    11:16:18.442178 69253 GUI DEBUG global_uinputs.py:69: creating fake UInput device: 'input-remapper keyboard'
    11:16:18.442295 69253 GUI DEBUG global_uinputs.py:69: creating fake UInput device: 'input-remapper gamepad'
    11:16:18.442342 69253 GUI DEBUG global_uinputs.py:69: creating fake UInput device: 'input-remapper mouse'
    11:16:18.555787 69253 GUI DEBUG groups.py:337: Discovering device paths
    11:16:18.556322 69253 GUI DEBUG groups.py:378: Found "3_1_1_input-remapper", "/dev/input/event21", "input-remapper gamepad", type: gamepad
    11:16:18.556593 69253 GUI INFO groups.py:449: Found "input-remapper gamepad"
    11:16:18.637479 69385 GUI-Helper DEBUG pipe.py:79: Using existing pipe for "/tmp/input-remapper-inky/results"
    11:16:18.637602 69385 GUI-Helper DEBUG pipe.py:79: Using existing pipe for "/tmp/input-remapper-inky/commands"
    11:16:18.638768 69385 GUI-Helper DEBUG groups.py:337: Discovering device paths
    11:16:18.639365 69385 GUI-Helper DEBUG groups.py:378: Found "3_1_1_input-remapper", "/dev/input/event22", "input-remapper mouse", type: mouse
    11:16:18.639627 69385 GUI-Helper DEBUG groups.py:378: Found "3_1_1_input-remapper", "/dev/input/event21", "input-remapper gamepad", type: gamepad
    11:16:18.639992 69385 GUI-Helper DEBUG groups.py:378: Found "3_1_1_input-remapper", "/dev/input/event20", "input-remapper keyboard", type: keyboard
    11:16:18.641713 69385 GUI-Helper DEBUG groups.py:378: Found "3_10874_39448_usb-0000:00:14.0-8", "/dev/input/event7", "CASUE CASUE USB Keyboard System Control", type: unknown
    11:16:18.641959 69385 GUI-Helper DEBUG groups.py:378: Found "3_10874_39448_usb-0000:00:14.0-8", "/dev/input/event6", "CASUE CASUE USB Keyboard Consumer Control", type: unknown
    11:16:18.642173 69385 GUI-Helper DEBUG groups.py:378: Found "3_10874_39448_usb-0000:00:14.0-8", "/dev/input/event5", "CASUE CASUE USB Keyboard", type: keyboard
    11:16:18.642332 69385 GUI-Helper DEBUG groups.py:378: Found "3_1133_50184_usb-0000:00:14.0-7", "/dev/input/event4", "Logitech USB Trackball", type: unknown
    11:16:18.642525 69385 GUI-Helper DEBUG groups.py:378: Found "3_32902_2056_usb-0000:00:14.0-6", "/dev/input/event3", "C-Media Electronics Inc.       USB PnP Sound Device", type: unknown
    11:16:18.643020 69385 GUI-Helper DEBUG groups.py:378: Found "25_0_3_PNP0C0E", "/dev/input/event0", "Sleep Button", type: unknown
    11:16:18.643325 69385 GUI-Helper INFO groups.py:449: Found "input-remapper mouse", "CASUE CASUE USB Keyboard", "Logitech USB Trackball", "C-Media Electronics Inc.       USB PnP Sound Device", "Sleep Button"
    11:16:18.657849 69253 GUI DEBUG reader.py:99: Received 5 devices
    11:16:18.658359 69253 GUI DEBUG preset.py:379: The newest preset is "Logitech USB Trackball", "marcia"
    11:16:18.658460 69253 GUI DEBUG user_interface.py:592: Selecting device "Logitech USB Trackball"
    11:16:18.658557 69253 GUI DEBUG user_interface.py:383: "Logitech USB Trackball" presets: "marcia"
    11:16:18.658710 69253 GUI DEBUG user_interface.py:698: Selecting preset "marcia"
    11:16:18.658977 69253 GUI DEBUG editor.py:323: Disabling the text input
    11:16:18.659441 69253 GUI DEBUG editor.py:323: Disabling the text input
    11:16:18.659797 69253 GUI INFO preset.py:170: Loading preset from "/home/inky/.config/input-remapper/presets/Logitech USB Trackball/marcia.json"
    11:16:18.659918 69253 GUI DEBUG preset.py:200: <EventCombination (1, 275, 1)> maps to ('wheel(down, 10)', 'mouse')
    11:16:18.659979 69253 GUI DEBUG preset.py:200: <EventCombination (1, 276, 1)> maps to ('wheel(up, 10)', 'mouse')
    11:16:18.660150 69253 GUI DEBUG system_mapping.py:91: Gathering available keycodes
    11:16:18.660195 69253 GUI DEBUG system_mapping.py:91: Gathering available keycodes
    11:16:18.673548 69253 GUI DEBUG system_mapping.py:120: Writing "/home/inky/.config/input-remapper/xmodmap.json"
    11:16:18.673963 69253 GUI DEBUG system_mapping.py:91: Gathering available keycodes
    11:16:18.683672 69253 GUI DEBUG system_mapping.py:120: Writing "/home/inky/.config/input-remapper/xmodmap.json"
    11:16:18.688243 69253 GUI DEBUG system_mapping.py:120: Writing "/home/inky/.config/input-remapper/xmodmap.json"
    11:16:18.690163 69253 GUI DEBUG editor.py:338: Enabling the text input
    11:16:18.690629 69253 GUI DEBUG editor.py:338: Enabling the text input
    11:16:18.690923 69253 GUI DEBUG reader.py:190: Sending start msg to helper for "Logitech USB Trackball"
    11:16:18.690997 69253 GUI DEBUG reader.py:206: Clearing reader
    11:16:18.691140 69385 GUI-Helper DEBUG helper.py:105: Received command "Logitech USB Trackball"
    11:16:18.691302 69385 GUI-Helper DEBUG helper.py:160: Starting reading keycodes from "Logitech USB Trackball"
    11:16:18.791923 69253 GUI DEBUG autocompletion.py:90: get_incomplete_parameter text:  match: None
    11:16:24.225496 69253 GUI DEBUG reader.py:162: down ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท <InputEvent ['BTN_LEFT', 'BTN_MOUSE'] (272) down>
    11:16:24.225835 69253 GUI DEBUG reader.py:182: read result ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท <EventCombination (1, 272, 1)>
    11:16:24.226058 69253 GUI DEBUG editor.py:598: Recording toggle is not on
    on_text_input_unfocus
    11:16:24.261719 69253 GUI DEBUG user_interface.py:741: Not saving because preset did not change
    11:16:24.262123 69253 GUI INFO user_interface.py:532: Applying preset "marcia" for "Logitech USB Trackball"
    11:16:24.264031 69278 Service INFO global_config.py:105: Loaded config from "/home/inky/.config/input-remapper/config.json"
    11:16:24.266411 69278 Service DEBUG daemon.py:267: Refreshing because last info is too old
    11:16:24.369000 69278 Service DEBUG groups.py:337: Discovering device paths
    11:16:24.371341 69278 Service DEBUG groups.py:378: Found "3_1_1_input-remapper", "/dev/input/event22", "input-remapper mouse", type: mouse
    11:16:24.372592 69278 Service DEBUG groups.py:378: Found "3_1_1_input-remapper", "/dev/input/event21", "input-remapper gamepad", type: gamepad
    11:16:24.374500 69278 Service DEBUG groups.py:378: Found "3_1_1_input-remapper", "/dev/input/event20", "input-remapper keyboard", type: keyboard
    11:16:24.381833 69278 Service DEBUG groups.py:378: Found "3_10874_39448_usb-0000:00:14.0-8", "/dev/input/event7", "CASUE CASUE USB Keyboard System Control", type: unknown
    11:16:24.382778 69278 Service DEBUG groups.py:378: Found "3_10874_39448_usb-0000:00:14.0-8", "/dev/input/event6", "CASUE CASUE USB Keyboard Consumer Control", type: unknown
    11:16:24.383816 69278 Service DEBUG groups.py:378: Found "3_10874_39448_usb-0000:00:14.0-8", "/dev/input/event5", "CASUE CASUE USB Keyboard", type: keyboard
    11:16:24.384791 69278 Service DEBUG groups.py:378: Found "3_1133_50184_usb-0000:00:14.0-7", "/dev/input/event4", "Logitech USB Trackball", type: unknown
    11:16:24.385720 69278 Service DEBUG groups.py:378: Found "3_32902_2056_usb-0000:00:14.0-6", "/dev/input/event3", "C-Media Electronics Inc.       USB PnP Sound Device", type: unknown
    11:16:24.387518 69278 Service DEBUG groups.py:378: Found "25_0_3_PNP0C0E", "/dev/input/event0", "Sleep Button", type: unknown
    11:16:24.388953 69278 Service INFO groups.py:449: Found "input-remapper mouse", "CASUE CASUE USB Keyboard", "Logitech USB Trackball", "C-Media Electronics Inc.       USB PnP Sound Device", "Sleep Button"
    11:16:24.389682 69278 Service INFO preset.py:170: Loading preset from "/home/inky/.config/input-remapper/presets/Logitech USB Trackball/marcia.json"
    11:16:24.390418 69278 Service DEBUG preset.py:200: <EventCombination (1, 275, 1)> maps to ('wheel(down, 10)', 'mouse')
    11:16:24.390940 69278 Service DEBUG preset.py:200: <EventCombination (1, 276, 1)> maps to ('wheel(up, 10)', 'mouse')
    11:16:24.391749 69278 Service DEBUG daemon.py:461: Using keycodes from "/home/inky/.config/input-remapper/xmodmap.json"
    11:16:24.392062 69278 Service DEBUG system_mapping.py:91: Gathering available keycodes
    11:16:24.392344 69278 Service DEBUG system_mapping.py:91: Gathering available keycodes
    11:16:24.400445 69278 Service DEBUG system_mapping.py:144: Updated keycodes with 216 new ones
    11:16:24.407065 69528 Service INFO injector.py:301: Starting injecting the preset for "Logitech USB Trackball"
    11:16:24.408607 69253 GUI DEBUG reader.py:147: release ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท <InputEvent ['BTN_LEFT', 'BTN_MOUSE'] (272) up>
    11:16:24.409034 69528 Service DEBUG context.py:90: Parsing macros
    11:16:24.410154 69528 Service DEBUG parse.py:420: preparing macro wheel(down,10) for later execution
    11:16:24.411113 69528 Service DEBUG parse.py:256: calls wheel with down,10
    11:16:24.411952 69528 Service DEBUG parse.py:313:   string down
    11:16:24.412245 69528 Service DEBUG parse.py:235:   number 10
    11:16:24.412470 69528 Service DEBUG parse.py:277: add call to wheel with ['down', 10], {}
    11:16:24.413505 69528 Service DEBUG parse.py:420: preparing macro wheel(up,10) for later execution
    11:16:24.413920 69528 Service DEBUG parse.py:256: calls wheel with up,10
    11:16:24.414232 69528 Service DEBUG parse.py:313:   string up
    11:16:24.414580 69528 Service DEBUG parse.py:235:   number 10
    11:16:24.414803 69528 Service DEBUG parse.py:277: add call to wheel with ['up', 10], {}
    11:16:24.415793 69528 Service DEBUG injector.py:198: Grabbing "/dev/input/event4" because of "<EventCombination (1, 275, 1)>"
    11:16:24.416189 69528 Service DEBUG injector.py:218: Grab /dev/input/event4
    11:16:24.536252 69528 Service DEBUG consumer_control.py:86: Starting to listen for events from /dev/input/event4, fd 31
    11:16:24.610226 69253 GUI INFO user_interface.py:643: Group "Logitech USB Trackball" is currently mapped
    11:16:24.947385 69278 Service INFO daemon.py:373: Request to autoload for "Logitech USB Trackball"
    11:16:24.947578 69278 Service INFO daemon.py:345: Autoloading for "Logitech USB Trackball"
    11:16:24.947701 69278 Service INFO preset.py:170: Loading preset from "/home/inky/.config/input-remapper/presets/Logitech USB Trackball/marcia.json"
    11:16:24.947916 69278 Service DEBUG preset.py:200: <EventCombination (1, 275, 1)> maps to ('wheel(down, 10)', 'mouse')
    11:16:24.948018 69278 Service DEBUG preset.py:200: <EventCombination (1, 276, 1)> maps to ('wheel(up, 10)', 'mouse')
    11:16:24.950368 69278 Service INFO injector.py:162: Stopping injecting keycodes for group "Logitech USB Trackball"
    11:16:24.950685 69528 Service DEBUG injector.py:268: Received close signal
    11:16:24.950798 69528 Service DEBUG injector.py:369: Injector coroutines ended
    11:16:24.959538 69278 Service DEBUG daemon.py:461: Using keycodes from "/home/inky/.config/input-remapper/xmodmap.json"
    11:16:24.959990 69278 Service DEBUG system_mapping.py:144: Updated keycodes with 0 new ones
    11:16:24.962315 69597 Service INFO injector.py:301: Starting injecting the preset for "Logitech USB Trackball"
    11:16:24.963045 69597 Service DEBUG context.py:90: Parsing macros
    11:16:24.963406 69597 Service DEBUG parse.py:420: preparing macro wheel(down,10) for later execution
    11:16:24.963699 69597 Service DEBUG parse.py:256: calls wheel with down,10
    11:16:24.963955 69597 Service DEBUG parse.py:313:   string down
    11:16:24.964067 69597 Service DEBUG parse.py:235:   number 10
    11:16:24.964127 69597 Service DEBUG parse.py:277: add call to wheel with ['down', 10], {}
    11:16:24.964428 69597 Service DEBUG parse.py:420: preparing macro wheel(up,10) for later execution
    11:16:24.964534 69597 Service DEBUG parse.py:256: calls wheel with up,10
    11:16:24.964625 69597 Service DEBUG parse.py:313:   string up
    11:16:24.964682 69597 Service DEBUG parse.py:235:   number 10
    11:16:24.964746 69597 Service DEBUG parse.py:277: add call to wheel with ['up', 10], {}
    11:16:24.990363 69597 Service DEBUG injector.py:198: Grabbing "/dev/input/event4" because of "<EventCombination (1, 275, 1)>"
    11:16:24.990588 69597 Service DEBUG injector.py:218: Grab /dev/input/event4
    11:16:25.102280 69597 Service DEBUG consumer_control.py:86: Starting to listen for events from /dev/input/event4, fd 35
    11:16:25.490524 69278 Service INFO daemon.py:373: Request to autoload for "Logitech USB Trackball"
    11:16:25.491074 69278 Service INFO daemon.py:345: Autoloading for "Logitech USB Trackball"
    11:16:25.491306 69278 Service INFO daemon.py:348: Not autoloading the same preset "marcia" again for group "Logitech USB Trackball"
    11:16:29.420538 69597 Service DEBUG keycode_mapper.py:515: maps to macro (wheel(down,10), mouse) ((1, 275, 1))
    11:16:29.421466 69597 Service DEBUG keycode_mapper.py:322: Macro sending (2, 8, -1) to mouse
    11:16:29.523692 69597 Service DEBUG keycode_mapper.py:322: Macro sending (2, 8, -1) to mouse
    11:16:29.624584 69597 Service DEBUG keycode_mapper.py:322: Macro sending (2, 8, -1) to mouse
    11:16:29.726169 69597 Service DEBUG keycode_mapper.py:322: Macro sending (2, 8, -1) to mouse
    11:16:29.827371 69597 Service DEBUG keycode_mapper.py:322: Macro sending (2, 8, -1) to mouse
    11:16:29.928471 69597 Service DEBUG keycode_mapper.py:322: Macro sending (2, 8, -1) to mouse
    11:16:30.019982 69597 Service DEBUG keycode_mapper.py:430: releasing macro ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท ((1, 275, 0))
    11:16:30.020325 69597 Service DEBUG keycode_mapper.py:443: releasing key ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท ((1, 275, 0))
    11:16:30.548099 69597 Service DEBUG keycode_mapper.py:515: maps to macro (wheel(up,10), mouse) ((1, 276, 1))
    11:16:30.548933 69597 Service DEBUG keycode_mapper.py:322: Macro sending (2, 8, 1) to mouse
    11:16:30.651316 69597 Service DEBUG keycode_mapper.py:322: Macro sending (2, 8, 1) to mouse
    11:16:30.752730 69597 Service DEBUG keycode_mapper.py:322: Macro sending (2, 8, 1) to mouse
    11:16:30.855148 69597 Service DEBUG keycode_mapper.py:322: Macro sending (2, 8, 1) to mouse
    11:16:30.956122 69597 Service DEBUG keycode_mapper.py:322: Macro sending (2, 8, 1) to mouse
    11:16:31.057179 69597 Service DEBUG keycode_mapper.py:322: Macro sending (2, 8, 1) to mouse
    11:16:31.158141 69597 Service DEBUG keycode_mapper.py:322: Macro sending (2, 8, 1) to mouse
    11:16:31.236360 69597 Service DEBUG keycode_mapper.py:430: releasing macro ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท ((1, 276, 0))
    11:16:31.236903 69597 Service DEBUG keycode_mapper.py:443: releasing key ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท ((1, 276, 0))
  8. sudo evtest would also be interesting while the first command is still running, to see how your mappings are injected.

For the mouse device It says:

***********************************************
  This device is grabbed by another process.
  No events are available to evtest while the
  other grab is active.
  In most cases, this is caused by an X driver,
  try VT-switching and re-run evtest again.
  Run the following command to see processes with
  an open fd on this device
 "fuser -v /dev/input/event4"
***********************************************

For my mouse remapped input (shown as "input-remapper Logitech USB Trackball forwarded") It says:

Event: time 1646144629.656928, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90004
Event: time 1646144629.656928, -------------- SYN_REPORT ------------
Event: time 1646144629.841097, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90004
Event: time 1646144629.841097, -------------- SYN_REPORT ------------
Event: time 1646144630.161114, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90005
Event: time 1646144630.161114, -------------- SYN_REPORT ------------
Event: time 1646144630.305430, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90005
Event: time 1646144630.305430, -------------- SYN_REPORT ------------

And for a "mouse" remapped input (shown as "input-remapper mouse") It says:

Event: time 1646144772.577351, type 2 (EV_REL), code 8 (REL_WHEEL), value -1
Event: time 1646144772.577351, -------------- SYN_REPORT ------------
Event: time 1646144772.679115, type 2 (EV_REL), code 8 (REL_WHEEL), value -1
Event: time 1646144772.679115, -------------- SYN_REPORT ------------
Event: time 1646144773.040097, type 2 (EV_REL), code 8 (REL_WHEEL), value 1
Event: time 1646144773.040097, -------------- SYN_REPORT ------------
Event: time 1646144773.140556, type 2 (EV_REL), code 8 (REL_WHEEL), value 1
Event: time 1646144773.140556, -------------- SYN_REPORT ------------

PS: I run the test clicking once the two buttons I've mapped in marcia.json

Edit: This problem is quite old, but I hadn't courage to submit the issue...

sezanzeb commented 2 years ago

Thanks for reporting the issue!

sends the "go back" and "go forward" commands

In addition to the keys you mapped it to?

This don't let me scroll some pages because It sends the "go back" and "go forward" commands, even with the injection.

please run sudo evtest and select the device that says "forwarded". Then press your mouse buttons that you mapped previously.

It think I never put effort into handling EV_MSC events correctly, which might cause the issues now.

Inky1003 commented 2 years ago

In addition to the keys you mapped it to?

My mouse has, beyond the 2 common buttons, 2 other buttons that do the "go back" and "go forward" buttons on web browsers, which are annoying. I mapped them to wheel(down, 10) and wheel(up, 10).

please run sudo evtest and select the device that says "forwarded". Then press your mouse buttons that you mapped previously.

I think i misunderstanded the inputs, but... when I said this:

For my mouse remapped input (shown as "input-remapper Logitech USB Trackball forwarded") It says:

I'm quite sure It's the forwarded device.

Edit:

I forgot to mention, both commands of wheel and go back/forward are sent by their respective buttons in input remapper and the system. The problem is that the go back/forward commands shouldn't be sent (which are system ones).

sezanzeb commented 2 years ago

Ok thanks, don't worry about the evtest.

Please try to install the no-ev-msc branch. To see if you installed it correctly, input-remapper-control --version should print "1b6cf4d3b9d92d1195f6218e11bc2bf0651a255c". Then restart the service sudo systemctl restart input-remapper and try again.

If this is working the todo is to stop EV_MSC events for mapped keys, and maybe as a second step to inject EV_MSC events that match the mapping for consistency.

It this is still not working, I'll give you a short guide about the evtest and the "forwarded" device to see if there are actually both wheel and side-button events being inejcted for whatever reason.

Inky1003 commented 2 years ago

Okay, I'm quite confused. Nothing says this is the no-ev-msc branch, but the folder I downloaded that says It's from the branch, and no more EV_MSC events are sent (or at least detected by evtest). I did:

  1. Run this command to check input-remapper-control version:
$ input-remapper-control --version
input-remapper 1.4.1  https://github.com/sezanzeb/input-remapper
python-evdev 1.4.0
  1. Restarted systemd service with sudo systemctl restart input-remapper
  2. Applied the same preset as above with the gtk gui
  3. Scrolled some webpages to check If they won't go back and forward
  4. As they were going back and forward, I ran sudo evtest, and no more EV_MSC commands were sent, neither EV_MSC commands nor any other was sent by the forwarded device when I clicked the mapped buttons.

Basically, It didn't work, but the events are not sent anymore.

sezanzeb commented 2 years ago

ok, so EV_MSC is not of interest. I frankly have no idea what EV_MSC is supposed to be

this is incredible, I wonder how chromium apps know that you clicked that button.

sezanzeb commented 2 years ago

I just tried it in vivaldi (chromium based browser) and could not reproduce the issue unfortunately

Inky1003 commented 2 years ago

Would you like to contact in another place to try to figure out the issue? I'm really on need to fix that... Of course we will go back here and update the issue after that, and I think that would be better... Maybe Jitsi or a Matrix client? Send me an email, It's on my profile.

Also, I remind that some years ago I used input-remapper (when It wasn't yet input-remapper but key-mapper, and debian packages were still a dream) and on openSUSE(don't remember the DE) the keys were working just fine and not sending forward the undesired events... Was something you weren't forwarding, so?

sezanzeb commented 2 years ago

Oh, I didn't realize that you also tested the forwarded device before already

To figure out if it was an update of input-remapper that broke it or an update of chromium, you could backup your ~/.config/input-remapper directory and then install older versions. In manjaro you'll have to checkout at the specific tag (for example git checkout 1.3.0) and then run the installation steps as shown in the readme. This would help to pin down the problem. You might need to delete the config directory before downgrading in order to get input-remapper/key-mapper to start.

Inky1003 commented 2 years ago

I'm still reproducing the bug with older versions... maybe this is a bug with the event that is being sent?

Inky1003 commented 2 years ago

What a confusing thing, now I'm not running any input-remapper and no events aren't being sent! Neither the go back/forward nor the scroll ones!

sezanzeb commented 2 years ago

Did you restart the service after installing a different version? Maybe that's why you are reproducing it with old versions as well

Inky1003 commented 2 years ago

I killed all the services with pkill before running again... But note that without input-remapper no events are sent, so probably this may be a event's problem?

sezanzeb commented 2 years ago

if input-remapper-service is not running, then it should look somewhat like this:

โžœ  ~ sudo evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:  Power Button
/dev/input/event1:  Power Button
/dev/input/event2:  Logitech USB Keyboard
/dev/input/event3:  Logitech USB Keyboard Consumer Control
/dev/input/event4:  Logitech USB Keyboard System Control
/dev/input/event5:  USB Optical Mouse
/dev/input/event6:  Microsoft Microsoftยฎ Nano Transceiver v2.0
/dev/input/event7:  Microsoft Microsoftยฎ Nano Transceiver v2.0 Mouse
/dev/input/event8:  Microsoft Microsoftยฎ Nano Transceiver v2.0 Consumer Control
/dev/input/event9:  Microsoft Microsoftยฎ Nano Transceiver v2.0 Consumer Control
/dev/input/event10: Microsoft Microsoftยฎ Nano Transceiver v2.0 System Control
/dev/input/event11: PC Speaker
/dev/input/event12: HD Pro Webcam C920
Select the device event number [0-12]: 5
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x1bcf product 0x5 version 0x110
Input device name: "USB Optical Mouse"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 272 (BTN_LEFT)
    Event code 273 (BTN_RIGHT)
    Event code 274 (BTN_MIDDLE)
    Event code 275 (BTN_SIDE)
    Event code 276 (BTN_EXTRA)
  Event type 2 (EV_REL)
    Event code 0 (REL_X)
    Event code 1 (REL_Y)
    Event code 6 (REL_HWHEEL)
    Event code 8 (REL_WHEEL)
    Event code 11 (REL_WHEEL_HI_RES)
    Event code 12 (REL_HWHEEL_HI_RES)
  Event type 4 (EV_MSC)
    Event code 4 (MSC_SCAN)
Properties:
Testing ... (interrupt to exit)
Event: time 1646415077.922869, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90005
Event: time 1646415077.922869, type 1 (EV_KEY), code 276 (BTN_EXTRA), value 1
Event: time 1646415077.922869, -------------- SYN_REPORT ------------
Event: time 1646415078.130868, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90005
Event: time 1646415078.130868, type 1 (EV_KEY), code 276 (BTN_EXTRA), value 0
Event: time 1646415078.130868, -------------- SYN_REPORT ------------
Event: time 1646415080.042865, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90004
Event: time 1646415080.042865, type 1 (EV_KEY), code 275 (BTN_SIDE), value 1
Event: time 1646415080.042865, -------------- SYN_REPORT ------------
Event: time 1646415080.234867, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90004
Event: time 1646415080.234867, type 1 (EV_KEY), code 275 (BTN_SIDE), value 0
Event: time 1646415080.234867, -------------- SYN_REPORT ------------
Inky1003 commented 2 years ago

I didn't noticed that... Now I redid, and the issue still happens, but I was thinking... maybe this issue is libinput related? Maybe in the past I used evdev and not libinput?

I said that because Xorg reports I'm using libinput, and libinput shows some more things:

event21 POINTER_SCROLL_WHEEL +0.000s vert -15.00/-120.0 horiz 0.00/0.0 (wheel) event21 POINTER_SCROLL_WHEEL +0.061s vert -15.00/-120.0 horiz 0.00/0.0 (wheel) event21 POINTER_SCROLL_WHEEL +0.416s vert 15.00/120.0 horiz 0.00/0.0 (wheel) event21 POINTER_SCROLL_WHEEL +0.478s vert 15.00/120.0 horiz 0.00/0.0 (wheel)

I wonder if one of that 2 numbers after "vert" are getting the pages forward and backward, instead of just scrolling... Anyways, is there any way of getting evdev driver again to work with my mouse?

sezanzeb commented 2 years ago

I honestly never messed around with libinput and the likes, so I can't say anything about that. I guess the number is the amount of wheel movement, it would surprise me if this causes the browser to go backward or forward in history.

Still no clue what is happening here, maybe you could give wayland a try

Inky1003 commented 2 years ago

I'm afraid Wayland could be not good for me... Also, Wayland do use libinput.

Btw, I'll continue checking possible causes for that...

Inky1003 commented 2 years ago

Update: Got to change my mouse driver to evdev and things seem to work different: Clicking the buttons without the service seems to scroll a bit and stop. Clicking the buttons with input-remapper service seems to do the same thing as before.

Weirder than before...

sezanzeb commented 2 years ago

Are you really sure that there is no input-remapper service present? sudo pkill -f input-remapper

Inky1003 commented 2 years ago

Yes, there aren't... Maybe It's the mouse wheel emulation?

Inky1003 commented 2 years ago

Still, I have to congratulate your scrolling. Despite It sends another event with the scroll, It works better.