I am using a Bluetooth keyboard with my laptop (running Fedora 33). Very annoyingly, in order to use the F keys, you need to press the "Fn" button, otherwise, they are mapped to special functions.
I am trying to follow this post to remap them, but I seem to be missing something
If I run evtest and, for instance press the F4 key (which is mapped to "copy" if I don't press Fn) I get
Input driver version is 1.0.1
Input device ID: bus 0x5 vendor 0x4e8 product 0x7021 version 0x11b
Input device name: "SKBWHBT19 Keyboard"
Supported events:
<long list of events>
Event: time 1615808184.907556, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e0
Event: time 1615808184.907556, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 0
Event: time 1615808184.907556, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70006
Event: time 1615808184.907556, type 1 (EV_KEY), code 46 (KEY_C), value 0
Event: time 1615808184.907556, -------------- SYN_REPORT ------------
So, clearly, F4 is triggering CTRL+C. I also get the codes for bus 0005, vendor 04e8 and product 7021
How would I go about remapping that to F4?
I created a file called /etc/udev/hwdb.d/bluetooth-keyboard.hwdb with the following content
evdev:input:b0005v04E8p7021
KEYBOARD_KEY_700e0=fn_f4
Followed by
systemd-hwdb update
udevadm trigger
But this does not work. I am not sure how to input the two scan codes 700e0 and 70006 in there...
I also tried something like
KEYBOARD_KEY_70004=b
Which should map "a" to "b" but that failed as well
EDIT: following advice by @meuh I added a * at the end of the first line in the hwdb file and this works! However, I can only remap single keys and not combinations. That is, using scan code 700e0 only catches left control, which does not really work as now pressing the F4 key triggers F4 + C.
Also, pressing the CTRL key triggers C.
Is there any way of overriding a specific physical key?