Status: This is fixed as of Kernel 4.18, see the accepted answer for details.
I just started using a Redragon Asura USB Keyboard. The keyboard works at a basic level, but unfortunately all the Ctrl, Alt keys and the Win key are mapped to the left shift key, which makes it quite hard to use.
The dmesg output is
[185765.848957] input: USB Keyboard as /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0/0003:0C45:760B.0022/input/input50 [185765.905395] hid-generic 0003:0C45:760B.0022: input,hidraw3: USB HID v1.11 Keyboard [USB Keyboard] on usb-0000:00:14.0-3/input0 [185765.949342] input: USB Keyboard as /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.1/0003:0C45:760B.0023/input/input51 [185766.009474] hid-generic 0003:0C45:760B.0023: input,hiddev0,hidraw4: USB HID v1.11 Keyboard [USB Keyboard] on usb-0000:00:14.0-3/input1 I've started debugging the key presses using xev, and I get the exact same key mapping for those keys. I might've mixed the KeyPress and KeyRelease events, but all in all they are the same ( see at the end of the post ).
What can I do to properly map the Ctrl, Alt and Win keys?
Left alt:
KeyRelease event, serial 36, synthetic NO, window 0x3200001, root 0xd7, subw 0x0, time 185237066, (307,429), root:(2272,538), state 0x1, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False Left ctrl:
KeyPress event, serial 36, synthetic NO, window 0x3200001, root 0xd7, subw 0x0, time 185265721, (443,237), root:(2408,346), state 0x0, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False Left shift:
KeyRelease event, serial 36, synthetic NO, window 0x3200001, root 0xd7, subw 0x0, time 185303441, (436,539), root:(2401,648), state 0x1, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False Win key:
KeyPress event, serial 36, synthetic NO, window 0x3200001, root 0xd7, subw 0x0, time 185327465, (399,367), root:(2364,476), state 0x0, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False Right Alt:
KeyPress event, serial 36, synthetic NO, window 0x3200001, root 0xd7, subw 0x0, time 185361768, (348,141), root:(2313,250), state 0x0, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False Right ctrl:
KeyPress event, serial 36, synthetic NO, window 0x3200001, root 0xd7, subw 0x0, time 185401328, (598,415), root:(2563,524), state 0x0, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False Edit: indeed, the keyboard shows up as two USB devices. I've uploaded the HID descriptors from /sys/debug/kernel/hid at
evtestas root, select USB keyboard, see if they show up at the same scan code there as well. If yes, we need the HID descriptor (I'll tell you how). If no, edit question with output ofsetxkbmap -print.type 1 (EV_KEY), code 42 (KEY_LEFTSHIFT), value 1mount -t debugfs none /sys/kernel/debugas root, put output of/sys/kernel/debug/hid/DEVICE/rdescfor allDEVICEyou can find into question (or pastebin, if too large). Does it also show up as two devices inlsusb?hexdump -C /dev/hidrawXon both hidraw devices (checkdmesgfor current numbers), each time: press each of the Ctrl/Alt/Win keys twice, press space bar at end a few times until the next line appears. Put output in pastebin.