Fedora Linux Support Community & Resources Center
  #1  
Old 8th November 2011, 08:38 PM
damagehead Offline
Registered User
 
Join Date: Apr 2008
Location: Bangalore, India
Age: 30
Posts: 53
linuxfirefox
Configure Keyboard key to behave differently

Hi,

My Left arrow key on my laptop keyboard just got screwed. It wont work any more, so i thought that i would configure the right ctrl to act as the left arrow key. For this i launched the following command

xmodmap -e "keycode 97 = Left"

97 being the keycode for the right ctrl key (as reported by showkey)

But the above command does not make any difference. I also tried adding the line
keycode 97 = Left
in /etc/X11/Xmodmap, and restarting X server. Still nothing.

Can you please help me in understanding how this is to be done.
I use KDE 4 on my Fedora 15, updated with the latest packages from the yum repos.

Looking forward to your responses.

Thanks and Regards
~Sameer
Reply With Quote
  #2  
Old 8th November 2011, 10:54 PM
cazo Offline
Registered User
 
Join Date: Sep 2005
Location: Redneck Riviera
Posts: 357
linuxchrome
Re: Configure Keyboard key to behave differently

I'm not certain, but I think showkey is for texmode (non-GUI).

Code:
xmodmap -pke | grep Control

keycode  37 = Control_L NoSymbol Control_L
keycode 105 = Control_R NoSymbol Control_R
shows that keycode 105 maps to Control_R (they key next to left arrow).

By the way, xev will show "X events" (like keypresses). Xmodmap will also accept keycode definitions on the commandline, without having to modify /etc/X11/Xmodmap, restart X, etc.

Try
Code:
xmodmap keycode 105 = Left
then, if it works OK, you can add it to /etc/X11/Xmodmap.

P.S. It's been a while since I've had to mess with xmodmap, so I don't know how much (more) help I can give.

Last edited by cazo; 8th November 2011 at 10:56 PM.
Reply With Quote
  #3  
Old 9th November 2011, 09:02 PM
damagehead Offline
Registered User
 
Join Date: Apr 2008
Location: Bangalore, India
Age: 30
Posts: 53
linuxfirefox
Re: Configure Keyboard key to behave differently

Hello,

Thanks for the information. I was able to get it work using

xmodmap -e "keycode 105 = Left"

But what i am noticing is that the Ctrl key press is also received when the Right Ctrl key is pressed. i.e. i can do Ctrl + C, etc using the Right Control key. Due to this i am having trouble enable autorepeat for the Right Control key using

xset r 105

Any ideas?

Thanks and Regards
~Sameer
Reply With Quote
  #4  
Old 11th November 2011, 01:39 AM
cazo Offline
Registered User
 
Join Date: Sep 2005
Location: Redneck Riviera
Posts: 357
linuxchrome
Re: Configure Keyboard key to behave differently

That's probably because Control_R is also a "modifier" key (along with Control_L, Shift_L, Shift_R, Alt_L, Alt_R, etc). xmodmap -p shows these. My guess is that you'll probably have to undefine Control_R as a modifier and make it just like the original Left (keycode 113 = Left NoSymbol Left).

That would also (likely) mean using only Control_L for the control+key combinations (like Ctrl+C).

Other options would be: pick another key (or key combination) to take the place of left arrow, use the left arrow on the number keypad (4), or repair/replace you laptop's keyboard.

I think the repair/replace option is probably your best bet. Since it "just got screwed", the key might just be dirty and is no longer making contact.

Good luck.
Reply With Quote
  #5  
Old 11th November 2011, 07:15 AM
damagehead Offline
Registered User
 
Join Date: Apr 2008
Location: Bangalore, India
Age: 30
Posts: 53
linuxfirefox
Re: Configure Keyboard key to behave differently

Hi,

Thanks for the response, Could not get it working.
I think i will go ahead and replace the keyboard (i think its beyond repair, i dropped liquid on it).

Your comments were very helpful.

Thanks and Regards
~Sameer
Reply With Quote
Reply

Tags
key binding, key code, key modifiers

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to configure your Gnome Terminal window size with keyboard shortcuts. benjo Guides & Solutions (No Questions) 3 18th March 2010 04:47 PM
Why do shutdown -h and shutdown -r behave so differently? jlixfeld Using Fedora 1 18th March 2008 06:00 PM
is there a way to configure additional keyboard/mouse buttons? Effie04 Hardware & Laptops 2 22nd May 2006 12:04 AM


Current GMT-time: 19:34 (Tuesday, 22-07-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat