LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices



Reply
 
Search this Thread
Old 03-03-2005, 04:45 PM   #1
TTL_2
LQ Newbie
 
Registered: Jul 2004
Location: Germany
Posts: 24

Rep: Reputation: 15
Question How to get special keys of a keyboard working?


Hello,
my keyboard has some extra keys (F13...F22) and I would like to use those under KDE. Pressing those keys in the command line results in the message keyboard: unrecognized scancode ( number ) - ignored
I searched and found a site ( http://howtos.linux.com/howtos/Keyboard-and-Console-HOWTO-14.shtml ) which described how to find out the scancodes for those keys. That worked so far. Next I should connect the scancodes with free keycodes. Moreover I found out that the keycodes 89...95 and 120...127 are not used with my current keyboard-layout (Generic 105 keys). I tried to connect scancode 5e de (key F13) with keycode 89 $setkeycodes 5ede 89 but an error message returns KDSETKEYCODE: The argument is invalid
failed to set scancode 5ede to keycode 89

I searched further and found the program xev. This program does return keycodes for the extra keys. But unfortunately the keycodes which are returned are equal to those of some common keys. As example F14 generates the same keycodes as End.

What do I need to do so that the special keys on my keyboard can be used properly?
Perhaps useful:
Keyboard: Siemens Nixdorf PS/2
System: Debian
Kernel: 2.4.25-1

Thank you in advanced.
 
Old 03-03-2005, 06:28 PM   #2
avarus
Member
 
Registered: Apr 2004
Location: Oxford, UK
Distribution: Ubuntu, Debian, various
Posts: 230
Blog Entries: 5

Rep: Reputation: 32
What do you actually want the keys to do?

If you want to use them as hot keys, you should try out 'lineakd' (google it and/or apt-get it). This will let you bind spare keys to commands without actually remapping them.

TIM
 
Old 03-04-2005, 04:19 AM   #3
TTL_2
LQ Newbie
 
Registered: Jul 2004
Location: Germany
Posts: 24

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by avarus
What do you actually want the keys to do?
I would like to have Cut, Copy, Paste and starting a program (eg Mozilla) on a single key under KDE.
Quote:

If you want to use them as hot keys, you should try out 'lineakd' (google it and/or apt-get it). This will let you bind spare keys to commands without actually remapping them.
I have tried lineakd, beside that my keyboard is not supported, the program seems to expect already right defined keycodes. But I get the same keycodes, already used for common keys:
Key Keycode Defined as
F13: 102 Right
F14: 103 End
F15: 107 Delete
F16: 106 Insert
F17: 101 No Symbol
F18: 110 Pause
F19: 124 ISO_Level3_shift
F20: 127 No Symbol
F21: 126 KP_Equal
F22: Act as the Windows-Start-Menu key
 
Old 03-05-2005, 01:18 PM   #4
avarus
Member
 
Registered: Apr 2004
Location: Oxford, UK
Distribution: Ubuntu, Debian, various
Posts: 230
Blog Entries: 5

Rep: Reputation: 32
Hi,

OK, I'm guessing a bit here, but since nobody else has chipped in I suppose anything I say is better than nothing...

Firstly, the command you were trying with setkeycodes should be:

setkeycodes 5e 89 (or setkeycodes 0x5e 89)

The second number represents the key-up event and you can ignore it.

Unfortunately I'm not sure that this will help you. The keyboard driver in XFree86 is notoriously bad at recognising extra keys - I believe it bypasses the kernel mappings and reads the scancodes directly. XOrg uses an updated and more flexible driver model.

Having your keyboard unsupported in lineak is not a problem as the config file is easy to write, but if they keys are being recognised as Right,End,etc in xev this is a non-starter as you say.

Also, I don't believe it is possible to bind keys to Cut/Copy/Paste as the commands to do this vary between programs (often Ctrl+C but not always). Starting Mozilla is easier to achieve.

Sorry for not being much help. Documentation for keyboard support under Linux is almost impossible to find - the best place to start is the README files hiding under /usr/lib/X11.

TIM
 
Old 03-05-2005, 02:56 PM   #5
TTL_2
LQ Newbie
 
Registered: Jul 2004
Location: Germany
Posts: 24

Original Poster
Rep: Reputation: 15
Hi,
at least setkeycodes is now working and while pressing the non default keys I do not get keyboard: unrecognized scancode messages any more.
Thanks to you I definitely know now that the translation of the scancodes to the keycodes on the Console and X-Window are independent. So setkeycodes and loadkeys is not what I need.
I searched a little bit and found http://www.infosun.fmi.uni-passau.de/~nils/type6/details.html Beside that the Page is a little bit older, the scancode to keycode translation seems definitely be hard-coded in XFree86.
Perhaps I will try to modify the source code as described on the page according to my keyboard when I have a lot of free time left.

Thank you
 
Old 03-05-2005, 05:31 PM   #6
avarus
Member
 
Registered: Apr 2004
Location: Oxford, UK
Distribution: Ubuntu, Debian, various
Posts: 230
Blog Entries: 5

Rep: Reputation: 32
Hi,

Glad to be of use. If you are going as far as modifying the source, you may first want to see if Xorg handles the keyboard properly. I'm told that you can get the Xorg deb packages for Ubuntu and install them, otherwise check this:

http://incubator.vislab.usyd.edu.au/...on_intrusive_x

Happy hacking,

TIM
 
  


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mapping Keyboard Special Keys(some success at long last) RedShirt Suse/Novell 0 11-13-2005 10:43 PM
Special Function Keys on a Logitech Keyboard linux-rulz Linux - Hardware 2 07-13-2005 08:16 AM
extra keyboard keys stopped working kaega2 Linux - Software 3 04-16-2005 11:57 PM
Keyboard mode keys not working Silverdaz Linux - Laptop and Netbook 0 07-29-2004 11:37 AM
Special Keys raven Linux - Laptop and Netbook 0 10-16-2003 10:21 AM


All times are GMT -5. The time now is 12:56 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration