2

I have a Samsung np870z5e laptop with builtin Numpad with ubuntu 16.04 and udev 229.

I have a 'Fn-lock' button, if I press it, the Numpad 0 button (KP_0) becomes 'Menu' button (xev reports it), or 'KEY_COMPOSE' (evtest reports it).

So I would like to permanently rewrite KEY_COMPOSE to KP_0. So even if I press FN-lock button on the keyboard the numpad's 0 key should stay 0 key. (no other key swaps, only the 0 key is problematic).

The keyboard is at:

/dev/input/event3
/dev/input/by-path/platform-i8042-serio-0-event-kbd

$ udevadm info /dev/input/by-path/plat*
P: /devices/platform/i8042/serio0/input/input3/event3
N: input/event3
S: input/by-path/platform-i8042-serio-0-event-kbd
E: BACKSPACE=guess
E: DEVLINKS=/dev/input/by-path/platform-i8042-serio-0-event-kbd
E: DEVNAME=/dev/input/event3
E: DEVPATH=/devices/platform/i8042/serio0/input/input3/event3
E: ID_INPUT=1
E: ID_INPUT_KEY=1
E: ID_INPUT_KEYBOARD=1
E: ID_PATH=platform-i8042-serio-0
E: ID_PATH_TAG=platform-i8042-serio-0
E: ID_SERIAL=noserial
E: KEYBOARD_KEY_74=prog1
E: KEYBOARD_KEY_75=www
E: KEYBOARD_KEY_78=mail
E: KEYBOARD_KEY_82=!switchvideomode
E: KEYBOARD_KEY_83=!battery
E: KEYBOARD_KEY_84=!prog1
E: KEYBOARD_KEY_86=!wlan
E: KEYBOARD_KEY_88=!brightnessup
E: KEYBOARD_KEY_89=!brightnessdown
E: KEYBOARD_KEY_96=!kbdillumup
E: KEYBOARD_KEY_97=!kbdillumdown
E: KEYBOARD_KEY_b1=!prog2
E: KEYBOARD_KEY_b3=!prog3
E: KEYBOARD_KEY_b4=!wlan
E: KEYBOARD_KEY_c5=!prog3
E: KEYBOARD_KEY_ce=!prog1
E: KEYBOARD_KEY_d5=!wlan
E: KEYBOARD_KEY_f7=!f22
E: KEYBOARD_KEY_f9=!f23
E: MAJOR=13
E: MINOR=67
E: SUBSYSTEM=input
E: USEC_INITIALIZED=1876095
E: XKBLAYOUT=hu
E: XKBMODEL=pc105

evtest output:

 sudo evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:  Lid Switch
/dev/input/event1:  Power Button
/dev/input/event2:  Power Button
/dev/input/event3:  AT Translated Set 2 keyboard
/dev/input/event4:  Video Bus
/dev/input/event5:  Video Bus
/dev/input/event6:  ETPS/2 Elantech Touchpad
/dev/input/event7:  WebCam SC-10HDP12631N
/dev/input/event8:  HDA Intel PCH Mic
/dev/input/event9:  HDA Intel PCH Headphone
/dev/input/event10: HDA Intel PCH HDMI/DP,pcm=3
Select the device event number [0-10]: 3
Input driver version is 1.0.1
Input device ID: bus 0x11 vendor 0x1 product 0x1 version 0xab41
Input device name: "AT Translated Set 2 keyboard"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 1 (KEY_ESC)
    Event code 2 (KEY_1)
    Event code 3 (KEY_2)
    ... (truncated for brevity)

So the bus should be: 0011, vendor should be 0x0001:

The hwdb file is this:

$ cat /etc/udev/hwdb.d/10-my-modifiers.hw 
evdev:input:b0011v0001*
 KEYBOARD_KEY_3a=leftalt     # bind capslock to leftalt
 KEYBOARD_KEY_38=leftctrl    # bind leftalt to leftctrl
 KEYBOARD_KEY_1a=a
 KEYBOARD_KEY_1b=b

updated via:

$ sudo udevadm hwdb --update && sudo udevadm trigger

But it does not work. I also tried with evdev:name:, evdev:atkbd:, still no luck.

How can I determine what is the correct evdev:input:b0011v0001* line?

Similar questions (none is working for me): udev keyboard remapping with hwdb for secondary keyboards Udev hwdb rule does not work

0

Try something like this:

evdev:atkbd:dmi:bvn*:bvr*:bd*:svn*:pn*:pvr*

On my Thinkpad x240 on Ubuntu 16.04 it works fine:

cat /etc/udev/hwdb.d/61-ThinkPad-X240-keyboard.hwdb
# ThinkPad X240: switch End and Insert keys (so that when Fn-Lock is enabled, End works without Fn).
#keyboard:dmi:bvn*:bvr*:bd*:svnLENOVO:pn*:pvrThinkPadX240:*
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnLENOVO:pn*:pvrThinkPadX240:*
 KEYBOARD_KEY_d2=end
 KEYBOARD_KEY_cf=insert

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.