remapeamento de teclado udev com hwdb NumLock 0

2

Eu tenho um laptop Samsung np870z5e com o Numpad integrado com o Ubuntu 16.04 e o udev 229.

Eu tenho um botão 'Fn-lock', se eu pressioná-lo, o botão Numpad 0 (KP_0) torna-se 'Menu' (xev reporta), ou 'KEY_COMPOSE' (evtest reporta).

Portanto, gostaria de reescrever permanentemente KEY_COMPOSE para KP_0. Então, mesmo que eu pressione o botão FN-lock no teclado, a tecla 0 do numpad deve permanecer na tecla 0. (sem outros swaps de teclas, apenas a tecla 0 é problemática).

O teclado está em:

/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

saída de evtest:

 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)

Portanto, o bus deve ser: 0011, vendor deve ser 0x0001:

O arquivo hwdb é este:

$ 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

atualizado via:

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

Mas isso não funciona. Eu também tentei com evdev:name: , evdev:atkbd: , ainda sem sorte.

Como posso determinar qual é a linha correta de evdev:input:b0011v0001* ?

Perguntas similares (nenhuma está funcionando para mim): remapeamento de teclado do udev com o hwdb para teclados secundários A regra do hwdb do Udev não funciona

    
por user12933 07.06.2016 / 22:21

1 resposta

0

Tente algo assim:

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

No meu Thinkpad x240 no Ubuntu 16.04 funciona bem:

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
    
por 04.07.2016 / 17:32

Tags