LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-29-2010, 03:28 AM   #1
Mr. Alex
Senior Member
 
Registered: May 2010
Distribution: No more Linux. Done with it.
Posts: 1,238

Rep: Reputation: Disabled
Question How to change keys on the keyboard?


Hi everybody!
For example I want * key to print #. I searched some Web pages about it but information was too complicated and I should learn about it. Do I have to if I just wanna change some keys? Anyway, can someone please explain me just how to do it (little HOWTO)?
 
Old 07-29-2010, 04:02 AM   #2
Tux Rules
Member
 
Registered: Feb 2009
Location: at my place
Distribution: Arch
Posts: 153

Rep: Reputation: 25
this it's very simple. You need a software named xev if you don't jave it installed allready. With xev you can read what's the certain key code of a button (keyboard, mouse or even remote control). When you type xev in a terminal a white window with a square inside of it will open, make sure that window will allways be on top when you press a certain key to get it's key code.

When I press the key "a" this it's what i get with xev:

KeyRelease event, serial 34, synthetic NO, window 0x2c00001,
root 0xb5, subw 0x0, time 7197966, (652,-14), root653,8),
state 0x0, keycode 38 (keysym 0x61, a), same_screen YES,
XLookupString gives 1 bytes: (61) "a"
XFilterEvent returns: False

so the key code of the button a it 38 (keycode 38 as it says)

With this key code you can assign it to run any kind of command and program you want. Ok it's just like assigning a regular shortcut to a key. For example I use FluxBox as a desktop enviroment so for me to assign a shortcut to a key it can be done editing ~/.fluxbox/keys where in this kind a manner 38 :Exec tvtime so my keyboard button "a" will open tvtime.

In gnome it's even simpler because shortcuts can be assigned using you GUI and I believe it's the same with KDE.
 
1 members found this post helpful.
Old 07-29-2010, 04:03 AM   #3
Tux Rules
Member
 
Registered: Feb 2009
Location: at my place
Distribution: Arch
Posts: 153

Rep: Reputation: 25
this it's very simple. You need a software named xev if you don't have it installed allready. With xev you can read what's the certain key code of a button (keyboard, mouse or even remote control). When you type xev in a terminal a white window with a square inside of it will open, make sure that window will allways be on top when you press a certain key to get it's key code.

When I press the key "a" this it's what i get with xev:

KeyRelease event, serial 34, synthetic NO, window 0x2c00001,
root 0xb5, subw 0x0, time 7197966, (652,-14), root653,8),
state 0x0, keycode 38 (keysym 0x61, a), same_screen YES,
XLookupString gives 1 bytes: (61) "a"
XFilterEvent returns: False

so the key code of the button a it 38 (keycode 38 as it says)

With this key code you can assign it to run any kind of command and program you want. Ok it's just like assigning a regular shortcut to a key. For example I use FluxBox as a desktop enviroment so for me to assign a shortcut to a key it can be done editing ~/.fluxbox/keys in this kind a manner 38 :Exec tvtime so my keyboard button "a" will open tvtime.

In gnome it's even simpler because shortcuts can be assigned using you GUI and I believe it's the same with KDE.
 
1 members found this post helpful.
Old 07-29-2010, 04:36 AM   #4
Mr. Alex
Senior Member
 
Registered: May 2010
Distribution: No more Linux. Done with it.
Posts: 1,238

Original Poster
Rep: Reputation: Disabled
What about
/usr/share/X11/xkb/symbols/[lang] ?

I can use it also to change keys, right?
 
Old 07-29-2010, 07:48 AM   #5
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721
Use Xmodmap.

Or if your DE provides a way to remap keys, use it.
 
  


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
Keyboard keys messed up on Logitech Illuminated Keyboard MikeyCarter Linux - Hardware 2 03-16-2010 08:25 AM
USB keyboard function keys/numeric keys on boot raypen Linux - Hardware 4 04-17-2008 03:07 PM
New keyboard with Volume keys, etc. vbguru12000 Debian 6 02-02-2005 10:13 AM
with keys is the keys that change languages? AKAKAK Fedora 2 01-25-2005 10:11 AM
Assigning keyboard shortcuts to keyboard keys the who Linux - Hardware 3 02-20-2004 09:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:28 AM.

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