3

I have a Microsoft All-in-One wireless media keyboard (n9z-00001) which behaves weirdly with my current distribution, Arch Linux. (Linux 3.19.3-3-ARCH #1 SMP PREEMPT Wed Apr 8 14:10:00 CEST 2015 x86_64 GNU/Linux)

$ lsusb | grep -i micro
Bus 001 Device 008: ID 045e:0800 Microsoft Corp. 

And this is what xinput yields. Note that there are two keyboards for this device, one with the peculiar (keys)

$  xinput list | grep -i micro
⎜   ↳ Microsoft Microsoft® Nano Transceiver v2.0    id=12   [slave  pointer  (2)]
⎜   ↳ Microsoft Microsoft® Nano Transceiver v2.0    id=11   [slave  pointer  (2)]
    ↳ Microsoft Microsoft® Nano Transceiver v2.0 (keys) id=10   [slave  keyboard (3)]
    ↳ Microsoft Microsoft® Nano Transceiver v2.0    id=9    [slave  keyboard (3)]

I can listen to the keys directly with evtest. Although it is the same keyboard

$ 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:  Video Bus
/dev/input/event3:  Video Bus
/dev/input/event4:  AT Translated Set 2 keyboard
/dev/input/event5:  Microsoft Microsoft® Nano Transceiver v2.0
/dev/input/event6:  Microsoft Microsoft® Nano Transceiver v2.0
/dev/input/event7:  Microsoft Microsoft® Nano Transceiver v2.0
/dev/input/event8:  ThinkPad Extra Buttons
/dev/input/event9:  HDA Digital PCBeep
/dev/input/event10: HDA Intel PCH Mic
/dev/input/event11: HDA Intel PCH Headphone
/dev/input/event12: HDA Intel HDMI HDMI/DP,pcm=3
/dev/input/event13: HDA Intel HDMI HDMI/DP,pcm=7
/dev/input/event14: HDA Intel HDMI HDMI/DP,pcm=8
/dev/input/event15: SynPS/2 Synaptics TouchPad
/dev/input/event16: Integrated Camera
/dev/input/event17: Logitech M705
/dev/input/event18: TPPS/2 IBM TrackPoint
/dev/input/event19: daskeyboard
/dev/input/event20: daskeyboard
Select the device event number [0-20]: 
  • The device id 9 from xinput corresponds to /dev/input/event5, which has all the regular keys except some of the media keys.
  • id 10 corresponds to /dev/input/event7, and has the media keys on F1-F4 and 6 other keys related to volume control and other microsoft stuff.
  • I am guessing that /dev/input/event6 corresponds to the touchpad on the keyboard.

The problem is with the function keys. Media keys that are placed where F1-F5 should be are assigned to the "(keys)" device, whereas F6-F12 are assigned with the other one. I want to map the media keys back to the function keys so that I don't have to press Fn every time.

Problem 1: Media keys (keys that are channeled through input device 10, the (keys) one) are not registered by xev. They generate output with showkey --scancodes and evtest, but they are not picked up by X. How to solve that?

Problem 2: Media keys that work through input device 9 send multiple scancodes, and AFAIK there is no way of remapping multiple keys with hwdb, as shown in here. The following are the scancodes sent by the media key on F7

Event: time 1430059493.552417, -------------- EV_SYN ------------
Event: time 1430059493.560416, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e0
Event: time 1430059493.560416, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 0
Event: time 1430059493.560416, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e3
Event: time 1430059493.560416, type 1 (EV_KEY), code 125 (KEY_LEFTMETA), value 0
Event: time 1430059493.560416, -------------- EV_SYN ------------

I have no idea how to bind multiple scan codes to a single event; right now X is detecting all the individual keys and maps them to the respective events. For example, according to the output above, media key on F7 sends Ctrl+Alt+Scanner. How can I do this, since googling left me with no results?

1

Instead of remapping the keys, you can press Fn+CapsLock which locks the F buttons to F buttons instead of multimedia and vice-versa if you press it again.

  • 1
    Unfortunately, this only works with newer firmware versions of the keyboard. It got implemented in the firmware after much negative feedback (Check the ratings in online shops). But there is no patch to fix old ones. Mine is from 2014/09 and doesn't have this functionality yet. I don't know when they added it. – RafiK Apr 7 '16 at 15:24
  • That is really awful, if my one didn't have this switch I wouldn't have bought it. I'm having other issues with the touchpad, it is not identified as a touchpad so I cannot disable tap click, the keyboard is nice, but those are big issues. – Stefano d'Antonio Apr 8 '16 at 8:15
0

i had the same problem finally after i uninstall xf86-input-joystick package problem solved https://forum.manjaro.org/t/microsof-all-in-one-keyboard-problem/15560

  • 1
    It would be great if you could write the essentials of your link into your answer. – Thomas Jan 14 '17 at 12:44
  • I am sorry i couldn't understand well but the answer has already written before link – Mustafa Özhan Jan 14 '17 at 23:21

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.