You are not logged in.
Those of us who are used to using a N.American desktop keyboard with the right-hand Shift key beside the / key are likely finding it a bit of a challenge to adapt to the EeePC's layout which places that Shift key to the right of the Up Arrow key. I'd actually like to see the following layout:
/ Shift Up
Left Right Down
Any suggestions on a keystroke modifier program that could accomplish this?
thanks
S
Offline
This just swaps the Up and shift keys around, not the Right and Down keys - but the principle is the same there anyway...
xmodmap -e "keycode 62 = Up" # Make the shift key go up xmodmap -e "keycode 98 = Shift_R" # Make the up key into shift xmodmap -e "add shift = Shift_R" # Make the new shift key actually do shifting xmodmap -e "remove shift = Up" # Stop the old shift key from shifting xset r 62 # Make the new Up key autorepeat #xset -r 98 # Make the new shift key not autorepeat, if you want
Last edited by vmlinuz (2007-11-06 3:19:14 am)
Offline
Strangely, I am not finding any issues with the location of the shift key. I don't care for the tight location of the space bar though.
now, a real trick if you get the mapping changed over to your preference would be to remove the shift key and the arrow key and swap them. Might want to re-map the PgUp function as well though.
Offline
I never use the right shift key, always the left. I don't know why either.
Offline
vmlinuz wrote:
This just swaps the Up and shift keys around, not the Right and Down keys - but the principle is the same there anyway...
vmlinuz, you are DA MAN! I knew there had to be a way (this is linux after all), but didn't remember where to look. thanks for saving me the effort of hunting down the answer. I suspect that this info will be useful to many others as well.
I put your code into a file called swapshift.sh, then made it executable:
chmod 0755 swapshift.sh
Then, to execute that script (for you linux noobs), I ensured that I specified the path name (I recall being very frustrated when I first learned that Linux couldn't find an executable right in front of its nose unless you prefixed it with a ./ ):
./swapshift.sh
Will I need to run this script each time I reboot the machine? I guess I'll learn soon enough. If that's required, I will likely be able to simply add it to the end of the /etc/rc.local file.
By the way, to physically switch the keys, lift up very gently on the LEFT side of the key with a paring knife or something similar, and gently press down in the new location until it snaps into place.
One more thing: I also want to switch the Right/End and Down/PgDn keys so the whole area there looks more symmetric: the bottom-right end of the keyboard will then look like this:
?/ Shift Up/PgUp
Left/Home Right/End Down/PgDn
It makes more sense for L and R to be beside each other, and Up and Down to be one above/below the other. To find out how to do that, I used the xev program which you can launch from the Terminal. It will tell you what keycode is being generated by each key. For example if you press the unadjusted Down key, you will see that it generates keycode 104. You can then tell xmodmap that it should treat keycode 104 as a Right.
I saved the following commands into a script called swapend.sh
xmodmap -e "keycode 104 = Right" # Make the down key go Right not Down xmodmap -e "keycode 105 = End" # make Fn Dn go End (Next) not Pg Dn xmodmap -e "keycode 102 = Down" # make Right go Dn xmodmap -e "keycode 103 = Next" # make Fn Right (End) go Pg Pn (Next)
Last thing, your suggested script does swap the Shift and Up keys, but of course we also have to consider the PgUp key, which is accessed by using Fn Up. I need to add the following lines to your script:
xmodmap -e "keycode 109 = Prior" # Make the Shift-shift key go PgUp xmodmap -e "keycode 99 = Control_R" # Make the PgUp key go Shift-shift
[update]: Here's what the final keyboard layout looks like:
Last edited by midtoad (2007-11-07 1:45:47 pm)
Offline
Perfect, I was wondering if someone would find a way to fix this. It really does suck in the stock location.
Offline
@giltwist, I put a link to my script in my /etc/rc.local file so it would run on boot. Anything in rc.local is supposed to run each time you boot. But for some reason that's not happening and I haven't had time yet to figure out why. So, each time I reboot, I open a terminal and re-run the script. A bit inconvenient, but it works.
Offline
Sorry about the absence, folks...
I did know that Fn+key is showing as a different key, rather than a modified key, so yes, that needs remapping as well.
The reason it doesn't work in the rc.local file is that it has to run *after* X has started, but within the X environment. The right place to put it is probably the /etc/X11/Xsession.d directory.
I'm not actually using this mapping, but my fingers are starting to get confused - got one keymap on my work laptop (which stays on my desk at the office), one on my main home machine, and one on the Eee ![]()
Offline
vmlinuz wrote:
The reason it doesn't work in the rc.local file is that it has to run *after* X has started, but within the X environment. The right place to put it is probably the /etc/X11/Xsession.d directory.
Hey, that's right! Good tip, I should have thought of that. I thought that it should go in rc.local since I want the change to take effect even when using Terminal, but now that I think about it, that Terminal is being launched from X and I never actually get to a normal tty session. I'll try the change tomorrow.
[update]: putting the script in /etc/X11/Xsession.d directory is NOT the thing to do. It caused X to crash, then the machine to reboot, ad infinitum. I had to resort to booting in single-user mode (see wiki) in order to remove the offending shortcut.
Last edited by midtoad (2007-11-14 11:48:54 am)
Offline
can some please write a walkthru for this? or at least inform where i can edit the file? im a total linux noob.
the right shift placement is a real issue for me. for now i have to completely abandon the use of right shift coz of that.
Offline
beadopapa wrote:
can some please write a walkthru for this? or at least inform where i can edit the file? im a total linux noob.
the right shift placement is a real issue for me. for now i have to completely abandon the use of right shift coz of that.
I'll probably put the instructions into a wiki posting. I assume you know how to run the text editor. Just create a file somewhere, say in your home directory, called setupkbd.sh. Into it put this content:
script below corrected November 21 11:17
#set up keyboard to exchange the Shift and Up keys, and the Down and Right keys xmodmap -e "keycode 62 = Up" # Make the Shift key go Up xmodmap -e "keycode 109 = Prior" # Make the Shift-shift key go PgUp xmodmap -e "keycode 98 = Shift_R" # Make thh Up key go Shift xmodmap -e "keycode 99 = Control_R" # Make the PgUp key go Shift-shift 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 98 # Prevent the new Shift key from autorepeating # xmodmap -e "keycode 104 = Right" # Make the down key go Right not Down xmodmap -e "keycode 105 = End" # make Fn Dn go End (Next) not Pg Dn xmodmap -e "keycode 102 = Down" # make Right go Dn xmodmap -e "keycode 103 = Next" # make Fn Right (End) go Pg Pn (Next) # echo "All Done setting up keyboard."
Now you've got a list of instructions, but you have to make that file executable. to do this you need to open a Terminal window (use Ctrl-Alt-T in Easy Mode). You'll see an indicator of which folder you're in:
/home/user>
check to see if your file is there:
ls -l setupkbd.sh
You should see something like:
-rw-r--r-- user user 988 2007-11-14 09:53 setupkbd.sh
(there are 3 sets of permissions: read, write, execute for owner, group, rest of world; the above file is read/write for owner, read-only for the group, read-only for world)
Now to make it executable, type:
chmod 0755 setupkbd.sh
Now you can check its permissions again with
ls -l setupkbd.sh
You should see something like this now:
-rwxr-xr-x user user 988 2007-11-14 09:53 setupkbd.sh
(the x's tell you that the file is now executable).
to execute this file, type:
./setupkbd.sh
the dot-slash says that the file is in the current directory.
If that works, then follow the rest of the instructions in the thread for moving the keycaps.
At the moment you'll have to execute (run) this file each time you restart the Eee PC; I'm trying to figure out how to get it to run automatically.
Last edited by midtoad (2007-11-21 1:17:56 pm)
Offline
giltwist wrote:
Well, for full (KDE) mode, just save the script to
/home/user/.kde/Autostart
However, this does not seem to be working in Easy Mode
I put a shortcut to the script there, and what happens is that it gets opened in text editor. Bizarre.
As for Easy Mode, it doesn't run KDE. Instead, it runs IceWM. So we should put it somewhere appropriate for that window manager.
Offline
Midtoad,
OH! I know what you are doing wrong. You forgot to give it execute permission. Assuming your script is named "swapkeys.sh" and is in the Autostart folder, type this
chmod 705 /home/user/.kde/Autostart/swapkeys.sh
Offline
giltwist wrote:
Midtoad,
OH! I know what you are doing wrong. You forgot to give it execute permission.
Well certainly that would be a reason for a script failing to execute. But not in this case. My script already has execute permission since I run it by hand on every boot.
Rather than put a copy of the script in the Autostart folder, I created a symbolic link to the actual script which resides elsewhere. For some reason the Autostart folder may then see this reference to the script name and just load it into the editor rather than executing it.
What I've done now is to create a new script in the Autostart folder that explicitly executes my other script:
exec /home/user/scripts/setupkbd.sh > null
Ok, that doesn't work either. The file still gets opened in Text Editor. Here is the solution: you need to explicitly tell the OS to call the shell to execute the contents of the file. So insert the following at the top of the script:
#!/bin/bash
Tested, and it works. Now my keyboard is properly set up automatically after every reboot (into Advanced Mode).
For automatic startup in Easy Mode, which uses IceWM for its Window Manager instead of KDE, see this wiki how-to I prepared: http://wiki.eeeuser.com/howto:startupscript
Last edited by midtoad (2007-11-21 12:22:04 am)
Offline
midtoad wrote:
For automatic startup in Easy Mode, which uses IceWM for its Window Manager instead of KDE, .... I'm still working on it.
I've stumbled across something that might work for automatic startup in Easy mode. It was for trying to solve another keyboard issue in another post (I needed the Caps Lock key to become Control instead).
http://forum.eeeuser.com/viewtopic.php?pid=22537
Offline
GREAT idea... only partially working for me.
I created setupkbd.sh in the Autostart directory and it only remaps the right arrow and down arrow. The SHIFT and UP seem to be in the original positions.
I've copied the script exactly as midtoad wrote it.
Help?
Offline
@CJ, are you using Advanced Mode or Easy Mode? If the latter, you need to create an executable file in your /home/user/.icewm directory called startup and put your script in there. BTW I've written a wiki entry on this topic: http://wiki.eeeuser.com/howto:moveshiftkey
Last edited by midtoad (2007-11-21 12:33:57 am)
Offline
Thanks for the note midtoad. Your wiki's are fantastic. ![]()
I'm actually using Advanced Mode with the full desktop.
The script *partially* works - two of the keys change position - but the shift and up don't, which is why I'm completely confused.
Offline
@CJ, what keyboard layout do you have? qwerty? azerty? What keyboard map are you using? US > Basic, or US > Intl? What keyboard definition are you using? 105 keys?
If you are not using US keyboard map, the actual keycodes emitted by your keys will be different from mine, and you will need to alter your setupkbd.sh.
Check your keycode definitions using xev, which you should start from the Terminal. This is a graphical app that traps and records all keyboard and mouse events. Position your mouse on the red X icon that closes the window (so you won't have to move the mouse again once you start typing), then press the Up key. When I do this, I get the following:
KeyPress event, serial 27, synthetic NO, window 0x20000001, root 0x69, subw 0x0, time 1692086123, (-8,26), root:(488,56), state 0x0, [b]keycode 98 (keysym 0xffe2, Shift_R)[/b], same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False
Note the part in bold. That's saying that when I press the Up key (i.e. the key next to the / key), it returns keycode 98, and it also tells me that 98 corresponds to Shift_R). Well yes, that's because the script is working for me. You should still get keycode 98 but the corresponding text description should say Up. If you don't see that, you should edit your script.
Wait a second... I see that the script I posted contains two copies of the mods to make for swapping the Down and Right keys, but none for the Shift and Up keys. I'll edit that post and also post the correction to the wiki. Sorry for the inconvenience!
Offline
EDIT 2: I've reconfigured two Eee PC's now, both working with the reconfigured keyboard in Basic and Advanced desktop modes.
I don't have the EeePC in front of me but I believe I'm using the same keyboard layout you are - QWERTY US-English. I'll try updating the script based on your latest changes and post back with results! ![]()
Last edited by C.J. (2007-11-25 5:58:56 pm)
Offline
midtoad wrote:
@CJ, are you using Advanced Mode or Easy Mode? If the latter, you need to create an executable file in your /home/user/.icewm directory called startup and put your script in there. BTW I've written a wiki entry on this topic: http://wiki.eeeuser.com/howto:moveshiftkey
The icewm startup script is designed to be executed by icewm-session. So in Easy Mode, an alternative and possibly more 'official' (yet less practical) method to get the startup script to work would be to open the '/usr/bin/startsimple.sh' script and replace:
icewmtray &
With
#icewmtray &
And
exec icewm
With
#exec icewm exec icewm-session
Offline