LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 12-27-2007, 08:41 PM   #1
violagirl23
Member
 
Registered: Aug 2007
Location: Michigan
Distribution: Gentoo, Arch
Posts: 33

Rep: Reputation: 15
Keycode Descripancy?


I have been reading this tutorial on making my print screen key work through xmodmap: http://gentoo-wiki.com/TIP_Make_a_Sc...rintScreen_Key
I CAN follow the instructions of course, but my question is actually one more to understand what is going on.
What exactly ARE keycodes? If I do the following command:
Quote:
xmodmap -pke | grep -i print
it prints out
Quote:
keycode 111 = Print Sys_Req
So I would this that this means the Print Screen key has the keycode 111. But if I try showkey in the terminal and press the print screen key, I get back keycode 99, and moreover, if I press the Delete key I get back keycode 111. So what does this mean and what is with the descripancy?! This is mostly just a curiosity issue here. What exactly ARE keycodes?
Well, I think I mostly get it. The key where the Print Screen key is is ALWAYS keycode 111, right? So this tutorial is just having you rename it to F13 for convenience, because it is easier and shorter to type?
Is that the reason?
I was just wondering.
Also, just wondering about the descripancy in the numbers from xmodmap -pke | grep -i print and showkey.
Otherwise, I got it working and all is well. ^_^
 
Old 12-29-2007, 08:14 AM   #2
dracolich
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 1,274

Rep: Reputation: 63
I just tried my Print Screen key using xev and get 111. All standard QWERTY keyboards should have the same codes assigned to the keys. The only differences might be "special" keys for multimedia and web browsing.

To answer your other questions I think your partway right. But it's not about being easier to type as much as having a name to associate with the key - something to tell X because it won't understand you saying "I want keycode 111 to PrintScreen." It would have to be "I want F13 to PrintScreen."

You can use the ~/.Xmodmap file to rearrange keys or to assign unused keycodes to new keys. That's where F13 and so on comes in. Something like, "keycode 111 = F13". There are also some reserved names like XF86Play, XF86WWW and more that are nice for multimedia keyboards. As long as this file is processed before X starts you can use the gui's hotkey mapping tool to assign functions to the new keys. Something like, assigning F13 to PrnScrn. In lighter wms like Fluxbox, you can map them by editing the appropriate file since there's no gui app for hotkeys.

Hope this helps.
 
  


Reply



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
acpi button 2 keycode iiv Slackware 2 08-01-2007 04:58 AM
backspace keycode sabeel Programming 1 04-10-2006 06:14 PM
keycode errors LQ496873 Linux - Hardware 0 02-17-2006 04:31 PM
how to use alt+keycode javierj Linux - Newbie 2 03-02-2005 06:37 AM

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

All times are GMT -5. The time now is 10:05 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
Open Source Consulting | Domain Registration