-   Linux - General (
-   -   Windows key lacking scan code (

DavidMcCann 01-18-2008 11:49 AM

Windows key lacking scan code
I've always used the Windows-specific keys for various useful tasks, but I've just got a new keyboard from KeySonic which has me stumped.

The right Windows key gives the keycode 116 as usual, but the left one is not returning 115 or any other code. When I run xev, instead of getting "KeyPress event" and "KeyRelease event", I get "FocusOut event" and "FocusIn event"; instead of a keycode I get "mode NotifyGrab, detail NotifyAncestor".

Can anyone explain what's going on here?

titopoquito 01-26-2008 08:26 AM

Maybe your key is recognized by the kernel but has no scancode. Type the key and look in /var/log/messages, is there any mention of it? You can then assign a scancode to it (for example "setkeycodes e029 123"). If it works xev should now give you another output and you could use Xmodmap to assign it a name.

titopoquito 01-26-2008 09:20 AM

Funnily with the new 2.6.24 kernel I experience the same behaviour with two keys on my laptop. Apparently they are recognized by the kernel (there was a patch about that) but don't get scancodes either, the messages look like you described them. So I will have to look for an answer too :( If I find something about that I will post it here ...

titopoquito 02-03-2008 05:53 AM

Some follow-up: I did not manage to get the keys produce a keycode per se, but if I combine them with Control, Shift or Alt key, the produce one -- and always the same, no matter which of the three keys I pressed. :confused: I guess I have to search on to see if it's because of my own settings or what causes this.

trogoz 02-15-2011 06:24 PM

The problem is the kernel can read the scancodes and maps them to a high keycode (>255) which X cannot read! Then the scancode is lost (2.6 kernels do strange things to re-gain scancodes of the keyboard) and u cannot re-assign a keycode to the key!
The solution is atkbd.softraw=0 kernel parameter which makes 2.6.9 or later kernels behave like 2.4 kernel and give real scancodes whit the showkey -s command!
With that u can then remap the key and use it in X!
I used it with a key with no scancode and keycode over 300 and remapped it to keycode 200 and it worked!
Watch out not to overwrite existing keycodes thou!!

PS: U can never assign a scancode!!! LOL!

frankbell 02-15-2011 08:47 PM

Try running xev. The output is kind of dense, but it may give you a lead.

From the Fluxbox wiki:


If you want to find out the name of a key, open a terminal and run 'xev'. When the "Event Tester" window has focus, it will capture mouse movement, mouse clicks, and keypress events, then provide output in the terminal. If a key you want to use has no name, you can use its keycode and Fluxbox will still understand.

trogoz 02-16-2011 06:04 AM

frankbell, he said he used xev and there was no key reporting, so how using xev again is supposed to help?
If the key has no scancode xev will never show it.

Hangdog42 02-16-2011 06:59 AM

You folks do recognize this thread is several years old, right?

frankbell 02-16-2011 07:04 PM


Originally Posted by trogoz (Post 4260154)
frankbell, he said he used xev and there was no key reporting, so how using xev again is supposed to help?
If the key has no scancode xev will never show it.

Thanks for straightening me out.

All times are GMT -5. The time now is 01:08 PM.