Status : Isto é corrigido a partir do Kernel 4.18, veja a resposta aceita para detalhes.
Acabei de começar a usar o Teclado USB Redragon Asura . O teclado funciona em um nível básico, mas infelizmente todas as teclas Ctrl, Alt e Win são mapeadas para a tecla Shift esquerda, o que dificulta muito o uso.
A saída do dmesg é
[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
Eu comecei a depurar as teclas pressionando xev , e recebo exatamente o mesmo mapeamento de teclas para essas chaves. Eu poderia ter misturado os eventos KeyPress e KeyRelease, mas no geral eles são os mesmos (veja no final do post).
O que posso fazer para mapear corretamente as teclas Ctrl, Alt e Win?
Alt esquerdo:
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
Ctrl esquerdo:
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
deslocamento para a esquerda:
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
Chave do Win:
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
Alt Direita:
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
Ctrl direito:
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
Editar : na verdade, o teclado aparece como dois dispositivos USB. Eu carreguei os descritores HID de / sys / debug / kernel / hid em