Closed thecodygriffin closed 7 months ago
After not finding anyway forward, I decided to abandon input-remapper for an alternative, and ultimately, simpler solution.
Although it is very specific to my hardware, I am hoping it may one day help someone else with similar needs.
Using the following resources (among others), I learned that systemd's udev can easily remap device inputs with simple configuration files placed in /etc/udev/hwdb.d/
.
Basically, what you want to do is:
evtest
to identify your device's input scan code/etc/udev/hwdb.d/
sudo systemd-hwdb update
sudo udevadm trigger
After that, assuming your configuration file is correct, the device input should then trigger the keyboard input desired.
As an example, here is my configuration file that I am using for my Microsoft Sculpt Ergonomic Mouse.
/etc/udev/hwdb.d/61-keyboard-local.hwdb
evdev:input:b0003v045Ep07A*
KEYBOARD_KEY_90004=key_leftmeta
KEYBOARD_KEY_700e7=key_rightmeta
It does not matter how many times that I disconnect and reconnect my laptop from my monitor (for which the RF dongle of the mouse is connected), it works every time.
I use a Dell UltraSharp 24" USB-C Monitor (U2419HC). I swap connecting to it between two different laptops daily using DisplayPort over USB C. Because of this, I plug my Microsoft Sculpt Ergonomic Mouse which uses a wireless RF dongle to the USB A port of the monitor so I can use it with both laptops. This effectively makes the monitor a dock/hub.
When I disconnect my personal laptop running Fedora 39 from the monitor and reconnect it, my key mapping of the BTN_SIDE button on the mouse to the Super_R key of the keyboard stops functioning. Restarting the input-remapper systemd process does not resolve the issue. I either have to completely restart my laptop or open the Input Remapper GUI and select the Apply button on the Editor page for the preset.
I find this odd because when I disconnect and reconnect the wireless RF dongle to a USB A port on the laptop itself, the issue is not reproducible.
To be honest, I am not looking for a code fix (although one would be appreciated if possible). I am just looking for a way to reapply my setting quickly from the Terminal without having to open the Input Remapper GUI and select the Apply button for the preset.
Thank you for reviewing and considering this behavior.
Output of 'input-remapper-control --version'
Linux Distribution, Desktop Environment, and Session Type Fedora 39, Gnome, and Wayland
Output of 'sudo ls -l /proc/1/exe'
lrwxrwxrwx. 1 root root 0 Dec 4 18:53 /proc/1/exe -> /usr/lib/systemd/system
Side Button to Super R.json from /.config/input-remapper-2/presets/Microsoft Microsoft 2.4GHz Transceiver v9.0
Log produced after 'sudo pkill -f input-remapper-service && input-remapper-gtk -d'
Output of 'sudo evtest' It just hangs on the "Testing... (interrupt to exit)" message. I suspect this is the case given the system effectively thinks my mouse side button is no longer mapped.