Table of Contents

How to move the right Shift key

If you're used to typing on a full-size keyboard, in many countries (at least, those using the qwerty layout) you'll find that the right Shift key is next to the / key. But on the Eee PC, the right Shift key is located one key further to the right. Because the Up key is located on the Eee PC where you'd expect to find the Shift key, you may find as you are typing that any time you go to capitalize a letter that you type with your left hand (e.g. an A), instead of capitalising the A, you instead move your cursor up a line and end up inserting an 'a' in the middle of some other word. Frustrating! You may decide you'd like your layout to be more like your full-size laptop. Here's how to do it.

kwrite /home/user/setupkbd.sh

 #!/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
 echo "All Done setting up keyboard."

chmod 0755 setupkbd.sh

 ./setupkbd.sh

What to do if the script doesn't work for all keys

If the script doesn't work for all of the keys, or you want to create a similar script for other keys, get a copy of xev if it is not already on your system: this is a graphical app that records all mouse and keyboard events. Start it from a Terminal window so you can see what it prints out, then move your mouse out of the way (it will generate many events if you move it). Now press a key. If you press the newly adjusted Shift key, you should see the following:

 KeyPress event, serial 27, synthetic NO, window 0x20000001, 
 root 0x69, subw 0x0, time 1692086123, (-8,26), root:(488,56), 
 state 0x0, **keycode 98 (keysym 0xffe2, Shift_R)**, same_screen YES, 
 XLookupString gives 0 bytes: 
 XmbLookupString gives 0 bytes:
 XFilterEvent returns: False 

The part in double asterisks is what we're after. You can see you generated a keycode 98 when you pressed that key, and it's current assigned to the Shift_R command (the default Eee PC had it assigned to the Up key).

Note: this wiki entry assumes that you have the qwerty layout and the US > Basic keyboard definition. Other arrangements will likely require modifications to the above script. If you have questions, post them to this forum

Run your key-shift script automatically at start-up

To run your keyboard setup script automatically at startup, see this wiki entry.

Windows NT, 2000, XP, 2003, Vista

The free utility SharpKeys can be used to remap keys in versions of Windows from NT to Vista. It requires .NET Framework 2.0.

Move your keycaps to reflect the new layout

Once your script is working well and starting at startup, you may want to move the keycaps so they actually say what they do. To physically switch the keys, lift up very gently on the left side of the key with a paring knife or something similar until the scissors mechanism that holds them in place pops off, and gently press down in the new location until they snap into place. Warning: If you lift off the keycaps with too much force, or lift up on the wrong side, you could break the mechanism that holds them in place. Don't say I didn't warn you.

Your new key layout should look like this:

On my unit surf 4g blk, my 'sissors mechanism' is on the right side. They came off using the left but it was a struggle..didn't break anything though. Be careful. PP


On my side, I found that when using the script at startup, each time you switch the keyboard layout, you need to run the script again. To fix that problem, I decide to modify the file /usr/share/X11/xkb/keycodes/xfree86 so the new layout is always available. Here is my diff output, hope this will help. ahudon

77c77
<     <RTSH> =  62;
---
>     <RTSH> =  98;
82c82
<     <RCTL> = 109;
---
>     <RCTL> =  99;
111c111
<     <PGUP> =  99;
---
>     <PGUP> = 109;
113,114c113,114
<     <END>  = 103;
<     <PGDN> = 105;
---
>     <END>  = 105;
>     <PGDN> = 103;
116c116
<     <UP>   =  98;
---
>     <UP>   =  62;
118,119c118,119
<     <DOWN> = 104;
<     <RGHT> = 102;
---
>     <DOWN> = 102;
>     <RGHT> = 104;