How to change map of scancode to keycode for wireless keyboard?
1
vote
0
answers
236
views
I have a wireless Logitech mouse and keyboard combo and I want to remap capslock to leftctrl and vice versa for the Linux console as well as the X terminal so I want to use the instructions [here](https://wiki.archlinux.org/title/Map_scancodes_to_keycodes) .
The steps I have taken so far are:
1. I have identified the scancodes that I am interested in by going to a virtual console with Ctrl+Alt+F1 and running:
showkey -s
to reveal the scancodes that I am interested in. These are in decimal so I convert them to hex to get the information I am interested in.
2. I found the keycode as suggested from the wiki (leftctrl, capslock in lowercase)
3. To find which /dev/input/eventX corresponds to the wireless devices I run: sudo evtest|less
This will output a list with options which match the Logitech keyboard and mouse. You select the desired option and on the top you can find some nice information.
4. To determine the whole evdev:input:b*v*p*e*-modalias string that must go into the .hwdb file I run cat /sys/class/input/eventX/device/modalias
where X is found in the previous step
5. I create a new 61-keyboard.hwdb in /etc/udev/hwdb.d (not in (/usr)/lib/udev/hwdb.d I found that this doesn't update hwdb.bin) and run: sudo systemd-hwdb update; sudo udevadm trigger
and run udevadm info /dev/input/by-path/*-*-*-kbd
to verify that my KEYBOARD_KEY_=` has been updated correctly
aaaaaand nothing happens.
I have tried rebooting as well but the change never happens.
I have tried globbing the evdev:input: line to make it more general but this has failed to work as well.
One thing that I have noticed is that VC keymap: n/a but I don't know if it helps at all.
[move]I'm moving![/move]
Also I don't know if this is important but I am trying to do this in a Raspberry Pi 4.
I am at my wit's end with this can someone help?
Asked by Satrapes
(11 rep)
Oct 5, 2022, 10:44 PM
Last activity: Oct 10, 2022, 01:41 PM
Last activity: Oct 10, 2022, 01:41 PM