LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 03-29-2009, 03:35 PM   #1
riwaJR
Member
 
Registered: Mar 2006
Location: Lund, Sweden
Distribution: Arch, Slack
Posts: 51

Rep: Reputation: 16
Question Is it possible to change the keycode on a key?


I have a keyboard (A4TECH X7 G800) that features duplicates of the keys: +-*/,. and some more. The reason to this is that they can be used in games (they have convenient positions). But several of these keys require a trailing char (, ) or a space (^~) to print, which renders them completely useless in games.

I've been (unsuccesfully) trying to elimininate the need for these "extra characters" so that they would print immediately, but being able to change one, say "." (period), without affecting the other would be a much better solution.

I found this when trying to find an answer:

Quote:
A little background note: When you hit a key on your keyboard, the linux kernel generates a raw scancode for it (if it's assigned). Each scancode can be mapped to a keycode. This is at kernel level. X has a (quasi) total independent way of mapping keys: X reads the kernel keycode table at startup, then map the keycode to its independent keycode table (it's the same as the kernel keycodes but different ). Then each keycode can be mapped to a keysym, i.e. a string which represent a key or suggest an action. Thus to have our keys fully functional, they need a kernel scancode/keycode plus a X keycode/keysym. It could seem weird, and it is, but X developers have their reason to keep a separate keyboard mapping from the kernel. It's not difficult at all, it's only a quite tedious procedure.


from --> http://whynotwiki.com/GNU/Linux_/_De...assing_through
But I've been googling about reading raw scancodes and I don't get how to do it. It just shows cryptic C programs and such.

So how would I (if possible) go forth with this?

Im running Ubuntu 8.10 and I use a Swedish keymap.

Thanks in advance

/Richard

Last edited by riwaJR; 03-29-2009 at 03:37 PM.
 
Old 03-29-2009, 10:15 PM   #2
Ziplock
LQ Newbie
 
Registered: Mar 2009
Distribution: CentOS, RedHat, Ubuntu, Fedora
Posts: 1

Rep: Reputation: 0
There is a tool called 'xmodmap' that should point you in the right direction. It's been a while since I played with this stuff, but the man page should give you a starting point.

Cheers
 
Old 03-30-2009, 12:14 AM   #3
riwaJR
Member
 
Registered: Mar 2006
Location: Lund, Sweden
Distribution: Arch, Slack
Posts: 51

Original Poster
Rep: Reputation: 16
xmodmap needs either scancodes or keycodes. Since xev produces the same, both scanc and keyc, it will affect both keys.
 
Old 03-30-2009, 04:40 AM   #4
vamped
LQ Newbie
 
Registered: Oct 2006
Posts: 14

Rep: Reputation: 0
Quote:
Originally Posted by Ziplock View Post
There is a tool called 'xmodmap' that should point you in the right direction. It's been a while since I played with this stuff, but the man page should give you a starting point.

Cheers
You could install and try xkeycaps, which is a graphical front end to xmodmap.
 
Old 03-30-2009, 11:03 AM   #5
riwaJR
Member
 
Registered: Mar 2006
Location: Lund, Sweden
Distribution: Arch, Slack
Posts: 51

Original Poster
Rep: Reputation: 16
Well thanks a lot for trying to help but if you'd read carefully you'd notice than neither xmodmap nor it's gui frontend will help me unless I can get my hands on some raw scancodes. Might not even work then.

If noone knows how to solve this do you know how to remove the necessity of the trailing space/char?
 
  


Reply

Tags
keycode


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
Can I change my auto-complete key? cheesypretzel Solaris / OpenSolaris 5 03-31-2006 11:37 AM
how to change mousekeys activator key? ichi Linux - General 0 11-04-2005 11:42 AM
How to Change What a Keyboard Key Returns mac57 Mandriva 0 01-30-2005 04:28 PM
change keycode that backspace sends on Redhat 7.2/8 AlexJ123 Red Hat 0 01-28-2005 03:54 AM
need to change a key on my keyboard ArnaudVR Slackware 1 06-27-2003 09:50 PM

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

All times are GMT -5. The time now is 01:29 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