Find the answer to your Linux question:
Results 1 to 2 of 2
Hi All, Am trying to map arrow keys in to some shortcuts like ctrl+h or shift+w anything in Centos linux.. I have googled around a lot but didn't find any ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2011
    Posts
    1

    Mapp Arrow Keys in CENTOS


    Hi All,

    Am trying to map arrow keys in to some shortcuts like ctrl+h or shift+w anything in Centos linux.. I have googled around a lot but didn't find any good result. Is there anyway we can do that??

    Thanx,
    Vio

  2. #2
    Linux User
    Join Date
    Dec 2011
    Location
    Turtle Island West
    Posts
    419
    xmodmap might do it for you.

    $HOME/.xmodmap:
    Code:
    ! If you have undefined keys, login as root and
    ! tail -f /var/log/syslog to find them while
    ! pounding on the undefined keys.
    
    ! Clear all the modifiers
    
    clear Lock
    clear Shift
    clear Control
    clear Mod1
    clear Mod2
    clear Mod3
    clear Mod4
    clear Mod5
    
    ! Then set them all up again
    
    keycode 50 = Shift_L
    keycode 62 = Shift_R
    ! Change Caps_Lock to Shift_L
    keycode 66 = Shift_L
    add Shift = Shift_L
    add Shift = Shift_R
    
    ! Left Win Key between Fn and Alt
    keycode 115 = Multi_key Meta_L
    
    keycode  37 = Control_L
    keycode 109 = Control_R Mode_switch
    add Control = Control_L
    add Control = Control_R
    
    keycode  64 = Alt_L
    keycode 113 = Alt_R
    add Mod1 = Alt_L
    add Mod1 = Alt_R
    
    ! Menu key between AltGr and Ctrl
    !keycode 117 = Menu F28
    keycode 117 = F28
    
    !add Mod1 = Mode_switch
    add Mod2 = Mode_switch
    !add Mod3 = Multi_key
    !add Mod3 = Meta_L
    !add Mod4 = Begin
    !add Mod5 = Mode_switch
    
    
    ! Mods: |Nothing|Shift|Mode_switch|Shift+Mode_switch|
    ! Ctrl-Up and Ctrl-Down arrows
    ! CTRL-Y for vim 0x19
    keycode  98 = Up Up 0x19 0x19
    ! CTRL-E for vim 0x05
    keycode 104 = Down Down 0x05 0x05
    
    ! euro and dollar keys by the arrows
    keycode 239 = Home 0xa4 0xa3 0xa9
    !keycode 239 = Begin
    ! this key is funny. The last one never works(???)
    keycode 160 = End 0x24 0xa2 0xb0
    
    ! the 4 launch keys in the top right
    keycode 174 = Caps_Lock
    add Lock = Caps_Lock
    keycode 176 = F25
    !keycode 178 = 0x13 0x11 0x11
    keycode 178 = F26
    !keycode 236 = 0x13 0x11 0x11
    keycode 236 = F27
    
    !keycode 22  = BackSpace
    Then go:
    [code]
    xmodmap ~/.xmodmap
    [code]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •