LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Changing the keyboard keys (that is, remapping them). (http://www.linuxquestions.org/questions/linux-general-1/changing-the-keyboard-keys-that-is-remapping-them-813266/)

stf92 06-09-2010 11:44 PM

Changing the keyboard keys (that is, remapping them).
 
Hi:
I want the system to see a certain keyboard key as if it were another key. To put an example, suppose I want each time I type 'e' the system sees 't'. Can this be done? Any suggestion would be greatly appreciated. Thanks for reading.

H_TeXMeX_H 06-10-2010 03:55 AM

Take a look at:

/usr/share/kbd/keymaps/i386/dvorak/dvorak.map.gz
/usr/doc/kbd-1.15/dvorak/dvorak.xmodmap

for some hints on how to remap keys, you'll probably have to make your own map file, and have the system use it. Not sure why you would want to do this, but you can. Also note that the console and Xorg can use different keymaps, so you have to change both.

Oh and the 'xev' command will come in handy for getting the key codes.

stf92 06-10-2010 12:03 PM

Quote:

Originally Posted by H_TeXMeX_H (Post 3998698)
Not sure why you would want to do this, but you can.

The reason is mine is a non-US keyboard and I find it awkward (uncomfortable). Specially because it has two additional keys between Alt and Ctrl (on the right), one of them with the logo of windows and the other with some kind of icon on it. Likewise on the left. I use Ctrl+Z a lot and always miss the control key. Plus, most of the special symbols have been relocated. And all this because we have an additional letter between n and o in our alphabet! They have left the old keyboard absolutely unrecognizable, with keys such as left shift and backspace half their original sizes.

Well, excuse me for this anger, but I had to tell somebody. Thanks for your reply. I have found all the files you have mentioned and will study the docs.

Enrique.

MTK358 06-10-2010 12:07 PM

Quote:

Originally Posted by stf92 (Post 3999193)
The reason is mine is a non-US keyboard and I find it awkward (uncomfortable). Specially because it has two additional keys between Alt and Ctrl (on the right), one of them with the logo of windows and the other with some kind of icon on it.

The "Windows Logo" key is actually the Super key. It existed before M$ and for some reason M$ decided to put their logo on it. It's actually quite useful. You can use it, for example, to launch applications of do special window manager actions.

And that other one is the menu key. It opens up the context menu for whatever is selected.

tredegar 06-10-2010 12:33 PM

xmodmap is the way to go. For example, I hate the "Caps lock" key, and prefer it just to work as "Shift"
So I run this at login:
Code:

xmodmap -e "remove Lock = Caps_Lock"
xmodmap -e "add Shift = Caps_Lock"

see man xmodmap and there are plenty of HOWTOs on the web

stf92 06-10-2010 12:41 PM

Yes. But what about when not having run X yet. I only start X in rare times. For example to enter LQ, Google or Wikipedia.

H_TeXMeX_H 06-10-2010 12:55 PM

Outside of Xorg, you just have to make a keymap file I think, so in '/usr/share/kbd/keymaps/i386/'. Then you can use 'loadkeys' to load it.

stf92 06-10-2010 01:02 PM

Quote:

Originally Posted by H_TeXMeX_H (Post 3999264)
Outside of Xorg, you just have to make a keymap file I think, so in '/usr/share/kbd/keymaps/i386/'. Then you can use 'loadkeys' to load it.

Thank you, H_TexMex_H. I have found a great deal of doc in my system. I'll study it. Regards.


All times are GMT -5. The time now is 08:56 AM.