Tech Support > Computers & Technology > Programming > changing keyboard's keys values (on linux)
changing keyboard's keys values (on linux)
Posted by Zero One on March 6th, 2004


I wanna write a program with the objective to:

Being able to re-assign a key's value/behaviour.

For example: making page-down act as page-up...
making ENTER act as ESC..
making num-lock act as F3... etc, etc..

I am a novice programmer with background in C/C++, PERL and other
languages that I'd rather not mention. (fxxxMS! fxxxSUN!) =)

I intend to write this thing in either one of those languages,
preferebly C || C++ and I wanna make it run on a linux system. I have
some idea of where to begin (stdin) but since my knowledge doesnt
currently extend far I'm requesting some help/pointers about getting
this thingy swapping keys!

Maybe we can make an OpenSource project out of this?

Thanks much,

// ZerOne

Posted by Michael Mendelsohn on March 6th, 2004


Zero One schrieb:
So you want to reinvent the keymap?

Michael
--
Feel the stare of my burning hamster and stop smoking!

Posted by Christian Gollwitzer on March 6th, 2004


Zero One wrote:
This program does already exist, its called xmodmap and such mechanism
is necessary, so that in non-english speaking countries it is possible
to enter non-ASCII characters.
There exists a graphical frontend, too, that is called xkeycaps.

For example, I have those Windows-keys on my keyboard. They are unused
in the standard keymapping, so I ran "xev", which shows every event from
X. Then I pressed those keys and found they have keycode 116 and 117.
After calling:

xmodmap -e "keycode 116= braceleft bracketleft"
xmodmap -e "keycode 117= braceright bracketright"

they were reassigned to braces & brackets (using shift-key), which is
useful in TeX-programming (consider that on a german keyboard on must
press the AltGr-key + 8 to get [ - not good for your fingers)


Similar Posts