You are not logged in.
Hello,
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_sc … o_keycodes
The steps I have followed so far are:
I have identified the scancodes that I am interested in by going to a virtual console with Ctrl+Alt+F1 and running:
showkey -sto 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.
I found the keycode as suggested from the wiki (leftctrl, capslock in lowercase)
To find which /dev/input/eventX corresponds to the wireless devices I run:
sudo evtest|lessThis 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.
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/modaliaswhere X is found in the previous step
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 triggerand run
udevadm info /dev/input/by-path/*-*-*-kbdto verify that my KEYBOARD_KEY_<HEX_SCANCODE_IN_LOWERCASE_WITHOUT_0x_PREFIX>=<KEYCODE_IN_LOWERCASE>` 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.
Edit: I tried this with a wired keyboard and the same thing happens. I am thinking that may be something is missing from the instructions on the wiki.
I am at my wit's end with this can someone help?
Last edited by satrapes (2022-11-08 10:35:32)
Offline
Thanks to this video I figured out that the problem was that the scancodes are not what I thought.
To get the value you need to run evtest instead of `showkey -s` and the proper scancode is the value after `MSC_SCAN`. In my case CAPSLOCK was not code 58 but rather code 70039.
I thing the wiki needs some clarification on the subject.
Offline