The solution is to
remap some keys, that is, to choose some
keys on your keyboard to peform certain
actions.
In my case, I wanted to avoid having to press Fn together with Up or Down to get PageUp or PageDown.
Step 0:
Choose a key, or a key combination, to perform the desired action. In my case, I wanted to reverse the behavior of pressing Up and Fn+Up and Down and Fn+Down. That means FOUR definitions: two key definitions (Up and Down) and two key combinations (Fn+Up and Fn+Down).
Step 2:
Discover how your system sees those keys, using the command "
xev" and pressing the keys whose id you want to discover. In my case pressing Up, Down, Fn+Up and Fn+Down produced the result below, which means:
1. Pressing Down produces the
kyecode 116, which is assigned to the
action Down.
KeyPress event, serial 31, synthetic NO, window 0x3a00001,
root 0xa5, subw 0x0, time 13735531, (165,-16), root(170,32),
state 0x0,
keycode 116 (keysym 0xff54,
Down), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
2. Pressing Up produces
keycode 111, assigned to
action Up.
KeyPress event, serial 34, synthetic NO, window 0x3a00001,
root 0xa5, subw 0x0, time 13739005, (165,-16), root(170,32),
state 0x0, keycode 111 (keysym 0xff52, Up), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
3. Pressing Fn+Down produces
keycode 117, assigned to
action Next (page down).
KeyPress event, serial 34, synthetic NO, window 0x3a00001,
root 0xa5, subw 0x0, time 13751243, (165,-16), root(170,32),
state 0x0, keycode 117 (keysym 0xff56, Next), same_screen YES,
XKeysymToKeycode returns keycode: 105
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
4. Pressing Fn+Up produces
keycode 112, with
action Prior (page up).
KeyPress event, serial 34, synthetic NO, window 0x3a00001,
root 0xa5, subw 0x0, time 13752671, (165,-16), root(170,32),
state 0x0, keycode 112 (keysym 0xff55, Prior), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
Once you know the keycode of the keys you would like to use, and the name of the actions you want to perform, you can assign the desired actions to the chosen keys.
Step 3: The following four commands will produce the desired change, valid only for the present X session:
Code:
# xmodmap -e "keycode 116 = Next"; xmodmap -e "keycode 111 = Down"
# xmodmap -e "keycode 117 = Prior"; xmodmap -e "keycode 112 = Up"
Step 3b: To get these changes for every session, after issuing the commands above, create a file called .Xmodmap (or whatever), with the following command:
Code:
# xmodmap -pke > .Xmodmap
Then, create a file called .
xinitrc in your home directory, containing just the following line:
Good luck!
Bookmarks