LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-18-2008, 11:49 AM   #1
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Xubuntu
Posts: 5,742

Rep: Reputation: 2126Reputation: 2126Reputation: 2126Reputation: 2126Reputation: 2126Reputation: 2126Reputation: 2126Reputation: 2126Reputation: 2126Reputation: 2126Reputation: 2126
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?
 
Old 01-26-2008, 08:26 AM   #2
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,634

Rep: Reputation: 144Reputation: 144
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.
 
Old 01-26-2008, 09:20 AM   #3
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,634

Rep: Reputation: 144Reputation: 144
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 ...
 
Old 02-03-2008, 05:53 AM   #4
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,634

Rep: Reputation: 144Reputation: 144
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. I guess I have to search on to see if it's because of my own settings or what causes this.
 
Old 02-15-2011, 06:24 PM   #5
trogoz
LQ Newbie
 
Registered: Feb 2011
Posts: 3

Rep: Reputation: 1
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!
 
Old 02-15-2011, 08:47 PM   #6
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 17,229
Blog Entries: 27

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

From the Fluxbox wiki:

Quote:
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.
 
Old 02-16-2011, 06:04 AM   #7
trogoz
LQ Newbie
 
Registered: Feb 2011
Posts: 3

Rep: Reputation: 1
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.
 
1 members found this post helpful.
Old 02-16-2011, 06:59 AM   #8
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 420Reputation: 420Reputation: 420Reputation: 420Reputation: 420
You folks do recognize this thread is several years old, right?
 
Old 02-16-2011, 07:04 PM   #9
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 17,229
Blog Entries: 27

Rep: Reputation: 5332Reputation: 5332Reputation: 5332Reputation: 5332Reputation: 5332Reputation: 5332Reputation: 5332Reputation: 5332Reputation: 5332Reputation: 5332Reputation: 5332
Quote:
Originally Posted by trogoz View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Mozilla Using Coverity to Scan Mozilla Source Code for Defects LXer Syndicated Linux News 0 08-14-2006 03:21 PM
Using Knoppix to scan Windows for Viri-How? tootlet Linux - Distributions 2 11-03-2005 06:38 AM
How to bind Windows key combos and laptop Fn key MDesigner Linux - Newbie 12 08-15-2004 03:08 AM
Linux to scan viruses on windows HeavyWeight Linux - Security 6 05-24-2004 07:40 PM
Key code? wyvis Linux - General 1 01-14-2003 01:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration