You are not logged in.

#1 2018-03-04 21:43:16

r4ptor
Member
Registered: 2012-12-30
Posts: 46

[SOLVED] Some special keys not working on T470

Hi folks,
I have a small problem here with my Thinkpad T470.
All special keys(Volume up/down and so on) are working, except the F9, F11 and F12 keys(gear, keyboard and star[no idea what they are mapped to by default in Windows]).

If I try to get the scancode with F9 is recognized with keycode 179, so this one I think I can figure out to remap. But, if F11 oder F12 are pressed(again, in the special feature mode, normal F11 works) xev won't even recognize it.

Any idea how to remap this keys? I tried a udev rule, but yeah, without scancodes.

evtest /dev/input/event5:      ThinkPad Extra Buttons 

lists

Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x17aa product 0x5054 version 0x4101
Input device name: "ThinkPad Extra Buttons"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 113 (KEY_MUTE)
    Event code 114 (KEY_VOLUMEDOWN)
    Event code 115 (KEY_VOLUMEUP)
    Event code 120 (KEY_SCALE)
    Event code 142 (KEY_SLEEP)
    Event code 144 (KEY_FILE)
    Event code 148 (KEY_PROG1)
    Event code 152 (KEY_SCREENLOCK)
    Event code 158 (KEY_BACK)
    Event code 171 (KEY_CONFIG)
    Event code 173 (KEY_REFRESH)
    Event code 190 (KEY_F20)
    Event code 191 (KEY_F21)
    Event code 194 (KEY_F24)
    Event code 205 (KEY_SUSPEND)
    Event code 212 (KEY_CAMERA)
    Event code 217 (KEY_SEARCH)
    Event code 224 (KEY_BRIGHTNESSDOWN)
    Event code 225 (KEY_BRIGHTNESSUP)
    Event code 227 (KEY_SWITCHVIDEOMODE)
    Event code 228 (KEY_KBDILLUMTOGGLE)
    Event code 236 (KEY_BATTERY)
    Event code 237 (KEY_BLUETOOTH)
    Event code 238 (KEY_WLAN)
    Event code 240 (KEY_UNKNOWN)
    Event code 364 (KEY_FAVORITES)
    Event code 372 (KEY_ZOOM)
    Event code 374 (KEY_KEYBOARD)
    Event code 466 (KEY_FN_F1)
    Event code 475 (KEY_FN_F10)
    Event code 476 (KEY_FN_F11)
    Event code 582 (KEY_VOICECOMMAND)
    Event code 592 (KEY_BRIGHTNESS_MIN)
  Event type 4 (EV_MSC)
    Event code 4 (MSC_SCAN)
  Event type 5 (EV_SW)
    Event code 3 (SW_RFKILL_ALL) state 1

dmesg shows some weird errors regarding this(probably?)

[37083.642304] thinkpad_acpi: unhandled HKEY event 0x6032

Any ideas? Is this behaviour because the event code of the keys is >255(X11 keycode limit)?

For F9 xev lists

KeyRelease event, serial 37, synthetic NO, window 0x3c00001,
    root 0x128, subw 0x0, time 37602056, (-320,212), root:(551,694),
    state 0x10, keycode 179 (keysym 0x1008ff81, XF86Tools), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

So i created

/etc/udev/hwdb.d/90-thinkpad-keyboard.hwdb
evdev:name:ThinkPad Extra Buttons:dmi:bvn*:bvr*:bd*:svnLENOVO*:pn*
 KEYBOARD_KEY_179=<command>

and ran

udevadm hwdb --update

But still the key doesn't respond.

Am I missing something here? Thanks.

Last edited by r4ptor (2018-03-05 20:44:42)

Offline

#2 2018-03-04 23:40:55

stanna
Member
From: melb.au
Registered: 2017-03-24
Posts: 100

Re: [SOLVED] Some special keys not working on T470

curious. what kernel version?

Offline

#3 2018-03-05 08:44:48

r4ptor
Member
Registered: 2012-12-30
Posts: 46

Re: [SOLVED] Some special keys not working on T470

Kernel version 4.15.6-1

Offline

#4 2018-03-05 09:03:23

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,860

Re: [SOLVED] Some special keys not working on T470

1. sure you're using evdev and not libinput?
2. do the keys show up in showkey?
3. did you literally add "KEYBOARD_KEY_179=<command>"? The key itself seems fine anyway, just XF86Tools isn't bound to anything in your shortcut daemon / desktop session.

Offline

#5 2018-03-05 10:31:46

r4ptor
Member
Registered: 2012-12-30
Posts: 46

Re: [SOLVED] Some special keys not working on T470

seth wrote:

1. sure you're using evdev and not libinput?

currently I have xf86-input-libinput-0.26.0-1 installed

seth wrote:

2. do the keys show up in showkey?

Yeah, the keys now show up with showkey.
F9 has keycode 171, F11 keycode 374 and F12 keycode 364

seth wrote:

3. did you literally add "KEYBOARD_KEY_179=<command>"? The key itself seems fine anyway, just XF86Tools isn't bound to anything in your shortcut daemon / desktop session.

For testing what was added is

KEYBOARD_KEY_171=XF86Display

But this doesn't work, neither for F9 nor F11 or F12.

Interesting enough, that showkey lists 171 as keycode for F9 and xev lists keycode 179 for F9...

Offline

#6 2018-03-05 13:21:26

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,860

Re: [SOLVED] Some special keys not working on T470

currently I have xf86-input-libinput-0.26.0-1 installed

That doesn't answer the question, consult your xorg log for the used driver . If you're on libinput, evtest results are not relevant (but you could oc. test the behavior using evdev)
Overmore since the keys show in showkey, so the kernel generates events and this is a matter of the xorg driver.
Be sure to move the /etc/udev/hwdb.d/90-thinkpad-keyboard.hwdb thing out of the way first.

Offline

#7 2018-03-05 20:22:36

r4ptor
Member
Registered: 2012-12-30
Posts: 46

Re: [SOLVED] Some special keys not working on T470

Yeah currently libinput is being used.
F9 works now, but still f11 and 12 are a problem.

The keys are recognized by the kernel, this is correct. But their keycode is >255 so I guess I'm out of luck with libinput and X11 as far as a I found out over a little bit of research.

Offline

#8 2018-03-05 20:33:44

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,860

Re: [SOLVED] Some special keys not working on T470

libinput debug-events

Offline

#9 2018-03-05 20:38:33

r4ptor
Member
Registered: 2012-12-30
Posts: 46

Re: [SOLVED] Some special keys not working on T470

Solved it. The whole thread is useless, sorry big_smile

So the approach with the /etc/udev/hwdb.d/61-keyboard-custom.hwdb  was correct.

showkey gave me the result, F11 is mapped to 374 and F12 to 364.

After creating

/etc/udev/hwdb.d/61-keyboard-custom.hwdb  
evdev:name:ThinkPad Extra Buttons:dmi:bvn*:bvr*:bd*:svnLENOVO*:pn*
 KEYBOARD_KEY_45=prog1
 KEYBOARD_KEY_49=prog2

then

 
udevadm hwdb --update &&  udevadm trigger --sysname-match="event*" 

remapped the keys resulting in

F11 keycode 149
F12 keycode 148

therefore I am now able to assign keypress actions to the keys with the XFCE keyboard shortcut layout editor.

I really don't know what the problem was in the first place. Will update the wiki for the T470 in case anybody else has this problem.

Thank you for your time and patience.

Offline

Board footer

Powered by FluxBB