LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Remapping keys using xmodmap - "home" key (https://www.linuxquestions.org/questions/linux-newbie-8/remapping-keys-using-xmodmap-home-key-652268/)

leeko 06-28-2008 01:31 PM

Remapping keys using xmodmap - "home" key
 
Hi all,

I'm running Xandros linux on an EeePC, and I'm trying to remap some of the keyboard keys, with varying success. The reason is that the right shift key and fn key are less-than-ideally placed. I've physically swapped the right-shift and up keys, so that my layout now looks like this:

-----------------shift--up
menu--left--right-down

where "menu" is the "context menu" key.

I used the following startup script to remap them:

#!/bin/sh
# set up keyboard to exchange the Shift and Up keys, and the Down and Right keys
xmodmap -e "keycode 62 = Up" # Shift => Up
xmodmap -e "keycode 109 = Prior" # Shift-shift => PgUp
xmodmap -e "keycode 98 = Shift_R" # Up => Shift
xmodmap -e "keycode 99 = Control_R" # PgUp => Shift-shift
xmodmap -e "keycode 104 = Right" # Down => Right
xmodmap -e "keycode 105 = End" # PgDn => End
xmodmap -e "keycode 102 = Down" # Right => Down
xmodmap -e "keycode 103 = Next" # End => PgDn
xmodmap -e "add shift = Shift_R" # Make the new Shift key actually do shifting
xset r 62 # Make the new Up key autorepeat
xset r 109 # Make the new PgUp autorepeat
xset -r 98 # Prevent the new Shift key from autorepeating

-----------
This script works perfectly. However, I'm also trying to use xmodmap to allow me to use the left/home, right/end, up/pageup, and down/pagedown keys with the menu key as a mode-switcher (i.e menu+up=pageup). I'm using this script (modified from a script posted on another eeeuser.com):

# fix key mappings for Menu + up/down/left/right
xmodmap -e "keycode 117 = Mode_switch"
xmodmap -e "keycode 97 = Left NoSymbol Home"
xmodmap -e "keycode 62 = Up NoSymbol Prior"
xmodmap -e "keycode 104 = Right NoSymbol End"
xmodmap -e "keycode 102 = Down NoSymbol Next"

I appended this to my existing startup script, and it *almost* does everything I need. The one problem: The "home" key has stopped working. The left key works fine (home is fn+left). The left/home key's physical position has not been altered, so I thought that

xmodmap -e "keycode 97 = Left NoSymbol Home"

would do the trick, but no joy... If anyone can shed some light on this, it would make me a very happy camper!

Thanks in advance,

Lee


All times are GMT -5. The time now is 03:58 PM.