Hello.
I (as the title states) have a G11 keyboard which comes with some multimedia keys which are recognized just fine. However, the keyboard also have a series of keys (G1-G18) which aren't working right.
Currently the G-keys act like so:
G1-G12 acts as F1-F12
G13-G18 acts as the numbers 1-6
Here's an example output from xev, first I'll press G5 and then I'll press F5:
Pressing G5
Code:
KeyPress event, serial 31, synthetic NO, window 0x2400001,
root 0x13a, subw 0x0, time 1700231459, (178,-32), root:(729,401),
state 0x0, keycode 71 (keysym 0xffc2, F5), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 31, synthetic NO, window 0x2400001,
root 0x13a, subw 0x0, time 1700231516, (178,-32), root:(729,401),
state 0x0, keycode 71 (keysym 0xffc2, F5), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
Pressing F5
Code:
KeyPress event, serial 31, synthetic NO, window 0x2400001,
root 0x13a, subw 0x0, time 1700265410, (204,-18), root:(755,415),
state 0x0, keycode 71 (keysym 0xffc2, F5), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 31, synthetic NO, window 0x2400001,
root 0x13a, subw 0x0, time 1700265498, (204,-18), root:(755,415),
state 0x0, keycode 71 (keysym 0xffc2, F5), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
This made me conclude that X11 is incapable of distinguishing between the two keys.
So, I read that key recognition functions like so:
Linux Key Recognition
Code:
{keypress} -> scancode(s) -> Linux Keycode -> X11 Keycode -> X11 keysym -> {Program receives signal}
So. I went out to the console to see if I could find the scancodes for my keys (which supposedly should be unique?) and map them to a unique keycode, thus resolving the mixup which happens further down the recognition chain.
I'm told that to capture the scancode of a key, one should write:
Code:
showkey -s (OR) showkey --scancodes
However, doing so for G5 produces this output
Code:
kb mode was UNICODE
press any key (program terminates after 10s of las keypress)...
0x9c
0x3f 0xbf
Letting the program terminate and repeating the process, pressing F5 this time instead of G5 produces the exact same output (0x9c is printed automatically each time)
Trying to obtain the keycodes instead by running showkey -k also produces the exact same output regardless of which of the two keys I press.
How can it be that I can't capture the real scancodes ? I really want these keys to work
Update
I've googled around and some comments to similar problems seem to indicate that somewhere in kernel 2.6 development they so generously decided to rewrite the whole input interface which, among other things, means that it's no longer possible for programs like showkey to obtain the actual raw codes.. It's somehow being provided with an emulated list..
They mentioned that if the key is unrecognized you can use dmesg or go through /var/log/messages and find an error about the unrecognized key where it's scancode will ALSO be.. So from there it's just a matter of using setkeycode and you're good..
If the system DOES recognize the key.. Obtaining the scancode seems to be much harder... I read something about a program called evtest but I can't get it to work for me.. Anyone... PLEASE ? I'm splitting hairs here