LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Reassign keyboard keys (http://www.linuxquestions.org/questions/programming-9/reassign-keyboard-keys-4175446023/)

maniakk 01-17-2013 09:40 AM

Reassign keyboard keys
 
I spilled some water on my keyboard a while back. I cleaned up the keyboard almost immediately. I noticed some of the keys didnt work. One started working shortly after cleaning it. The keys that dont work anymore are: Backspace, Apostrophe, h, and g. I figured if I didnt need my keypad (Which I dont use at all), then I would reassign those keys on my keypad. Currently, I have to search the alphabet on google and copy the letters g and h. Its getting real tedious... I know theres a way to reassign the keys, but I just dont know how to do it.

Im using Fedora 17 (Beefy Miracle) on an hp Pavillion g7 laptop.

danielbmartin 01-17-2013 10:08 AM

Reassigning keys should be a last resort. Try to clean your keyboard, to restore it to as-new functionality. Google "clean my keyboard" to find advice and videos. It can be done for little or no money.

Daniel B. Martin

maniakk 01-17-2013 10:21 AM

Quote:

Originally Posted by danielbmartin (Post 4872218)
Reassigning keys should be a last resort. Try to clean your keyboard, to restore it to as-new functionality. Google "clean my keyboard" to find advice and videos. It can be done for little or no money.

Daniel B. Martin

I just looked at some of those tips online just now. They all suggested I take apart my keyboard. Im NOT doing that. The last time I poppeed off a key, it never went back on. Its SUPER hard to put them back on. In fact, because of this, I no longer have my E and A keys. Theyre in baggies somewhere...

danielbmartin 01-17-2013 10:46 AM

Quote:

Originally Posted by maniakk (Post 4872228)
I just looked at some of those tips online just now. They all suggested I take apart my keyboard. Im NOT doing that. ...

Idea #1) Google linux remap keys
You will find advice including this:
http://forums.linuxmint.com/viewtopic.php?f=90&t=108803
I'm not endorsing any particular method since I haven't tried them.

Idea #2) Replace your keyboard. Your LQ profile doesn't give your location. In my part of the world used keyboards are giveaway items. In fact, the Microsoft ergonomic keyboard I'm using right now was a Craig's List "freebie."

Daniel B. Martin

maniakk 01-17-2013 10:57 AM

Quote:

Originally Posted by danielbmartin (Post 4872242)
Idea #1) Google linux remap keys
You will find advice including this:
http://forums.linuxmint.com/viewtopic.php?f=90&t=108803
I'm not endorsing any particular method since I haven't tried them.

Idea #2) Replace your keyboard. Your LQ profile doesn't give your location. In my part of the world used keyboards are giveaway items. In fact, the Microsoft ergonomic keyboard I'm using right now was a Craig's List "freebie."

Daniel B. Martin

Dont you think I searched that already before posting a new thread? I want to know which file to edit and what part. I was attempting to do this before, but I gave up on the account that there were too many files in that directory to know which layout I was using. And too I wasnt clear on what part of the file to edit and how.

maniakk 01-17-2013 11:46 AM

I saw sometin on te link you posted. XMODMAP? ow do I use it? Is tere a rapical UI for it?

theNbomr 01-17-2013 07:54 PM

Google xmodmap. It will allow you to remap keys using the X server (only). Here's a sample that swaps the CapsLock and Left Control keys to get you started.
Code:

#! /bin/sh

xmodmap -e 'remove Control = Control_L'
xmodmap -e 'remove Lock = Control_L'
xmodmap -e 'remove Control = Caps_Lock'
xmodmap -e 'remove Lock = Caps_Lock'

if [ $# -eq 0 -o "$1" = "ON" ]; then
        xmodmap -e 'add Lock = Control_L'
        xmodmap -e 'add Control = Caps_Lock'
else
        xmodmap -e 'add Control = Control_L'
        xmodmap -e 'add Lock = Caps_Lock'
fi

--- rod

maniakk 01-20-2013 02:52 PM

Thanks for all your help.
Xmodmap did the trick.
I used this script and ran it with xmodmap:
Code:

keycode 119 = BackSpace BackSpace BackSpace BackSpace NoSymbol NoSymbol Terminate_Server

keycode 81 = g G g G

keycode 79 = h H h H



All times are GMT -5. The time now is 06:19 AM.