LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 03-19-2011, 06:18 AM   #1
rizzy
Member
 
Registered: Mar 2004
Distribution: Debian
Posts: 283

Rep: Reputation: 65
Re-bind broken keyboard key to unused key


Hello,
My aging laptop has a key broken - the D key. To replace the keyboard is too expensive, not worth spending 100 on old hardware. I sometimes use an external USB keyboard just to type D but being laptop is not always convenient.
My question is how to bind key letter D to something else, be it a key combo or one of the unused/unneeded keys?
On this italian laptop keyboard there are some keys i never use like Mac style right click menu button next to AltGr or home/end keys i could spare for this.
 
Old 03-19-2011, 08:53 AM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,017

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
If you are running X then xmodmap is the tool you need
 
1 members found this post helpful.
Old 03-19-2011, 09:22 AM   #3
rizzy
Member
 
Registered: Mar 2004
Distribution: Debian
Posts: 283

Original Poster
Rep: Reputation: 65
Thank you, just what i was looking for
 
Old 03-19-2011, 11:12 AM   #4
rizzy
Member
 
Registered: Mar 2004
Distribution: Debian
Posts: 283

Original Poster
Rep: Reputation: 65
Code:
xmodmap -e 'keycode 135=d'
the key 135 is the Mac-style menu button.
 
Old 03-19-2011, 11:46 AM   #5
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,017

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
That works for you, and gives you a "d" ?
What about a "D" ?

Off-topic: I hate CAPS LOCK so make it act as SHIFT with these commands:
xmodmap -e "remove Lock = Caps_Lock"
xmodmap -e "add Shift = Caps_Lock"
 
Old 03-19-2011, 12:57 PM   #6
rizzy
Member
 
Registered: Mar 2004
Distribution: Debian
Posts: 283

Original Poster
Rep: Reputation: 65
D come up with normal 'shift+new d' press. Stuck the command in a script and openbox start up, works like a charm. Hardest bit is to retrain the mind, still take a bit of time remembering new location.. i like typing fast
 
  


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 broken, constantly pressed shift key gothicbob Linux - Hardware 4 03-16-2008 09:57 PM
Bind Mouse Button Combination to Keyboard Key Combination? neoAKiRAz Linux - Desktop 0 05-04-2007 12:49 PM
Fluxbox - bind one key to a key combo dracolich Linux - General 0 09-01-2005 03:53 PM
How to bind Windows key combos and laptop Fn key MDesigner Linux - Newbie 12 08-15-2004 03:08 AM
Bind Power Down Keyboard Key to Shutdown... jpsrm Linux - General 1 01-07-2003 12:05 AM


All times are GMT -5. The time now is 02:27 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration