Blog Forum Wiki Links Contact Us NetbookUser
RunCore Pro IV SSD Transforms your ASUS EEE PC by increasing 
performance 5-40X. Your satistfaction guaranteed RunCore Pro 70mm SATA Mini PCI-e SSD
RunCore Pro IV 70mm SATA II Mini PCI-e SSD
RunCore Pro IV 2.5 Inch SATA II SSD

You are not logged in.

#1 2007-11-11 6:45:13 pm

Krellan
Member
Registered: 2007-11-11
Posts: 38

Made Caps Lock key an additional Control

I used xmodmap to make my Caps Lock key an additional Control.  This helps make it easier to type.

Here's the .Xmodmap file, place it in your home directory at /home/user/.Xmodmap

Code:

! Forget any previous Caps Lock
clear Lock

! Make Caps Lock an additional Control
keycode 37 = Control_L
keycode 66 = Control_L

! Teach X once again that Control_L really does mean Control
add Control = Control_L

To get it to run automatically at startup, another file also needs to be created:

/etc/X11/Xsession.d/80xmodmap

This file contains this content:

Code:

# Krellan: Run the user's .Xmodmap file at startup -- Based on Ubuntu
# Place this file in your /etc/X11/Xsession.d/ directory
#
# This file is sourced by Xsession(5), not executed.
# The "|| true" is to ensure that the Xsession script does not terminate on error

USRMODMAP="$HOME/.Xmodmap"

if [ -x /usr/bin/xmodmap ]; then
        if [ -f "$USRMODMAP" ]; then
                /usr/bin/xmodmap "$USRMODMAP" || true
        fi
fi

This should work at startup, and run the xmodmap command against your .Xmodmap file in your home directory.

I wish that there were an easier way to shuffle keys around in Linux.  In Windows, it is just a single registry key smile

Offline

 

#2 2007-11-12 3:04:08 am

yakboy
Member
Registered: 2007-10-19
Posts: 92

Re: Made Caps Lock key an additional Control

Brilliant stuff, i always do this with my windows machines and was wondering how i would get by on xandros. With such a small keyboard this is an excellent tip and belongs in the wiki!

Don' suppose you know if any way of getting the key to print the date and time instead do you? would b v v v useful for GTD stuff.

Offline

 

#3 2007-11-12 8:14:32 pm

jhh112
Member
Registered: 2007-11-08
Posts: 91

Re: Made Caps Lock key an additional Control

I tried the recipe by Kreilan, together with adding a Compose key to allow typing of European accented characters. It works when I invoke xmodmap manually.  However, the automatic startup does NOT work. (and I did do a chmod a+x on the command file to be sure). Can anyone help resolve this? Quite important, as it allows the modification of the keyboard layout (the KDE tool only sort of works, ie, not all accents available wiith US intl setup, and the compose key feature does not work on EEE). thanks in advance.  jhh

Offline

 

#4 2007-11-15 3:16:31 pm

Krellan
Member
Registered: 2007-11-11
Posts: 38

Re: Made Caps Lock key an additional Control

jhh112 wrote:

I tried the recipe by Kreilan, together with adding a Compose key to allow typing of European accented characters. It works when I invoke xmodmap manually.  However, the automatic startup does NOT work. (and I did do a chmod a+x on the command file to be sure). Can anyone help resolve this?

Interesting.  The automatic startup seems to work just fine for me, using it right now.  I'm still in Easy mode, if that makes a difference (I don't think that it would).

Check all the filenames, make sure they are exact, since the 80xmodmap file calls them by exact name.

You shouldn't need to mark it as executable, since the 80xmodmap file is not executed directly, rather, it is sourced in by something else (the toplevel /etc/X11/Xsession script).

Try this command, from a terminal:

Code:

sh -e -x /etc/X11/Xsession.d/80xmodmap

If this works, you will see the xmodmap command being executed by the 80xmodmap file.  Hopefully, it should also give you an error message if something goes wrong, so you will be able to troubleshoot.

Offline

 

#5 2007-11-15 3:29:05 pm

Krellan
Member
Registered: 2007-11-11
Posts: 38

Re: Made Caps Lock key an additional Control

yakboy wrote:

Brilliant stuff, i always do this with my windows machines and was wondering how i would get by on xandros. With such a small keyboard this is an excellent tip and belongs in the wiki!

Don' suppose you know if any way of getting the key to print the date and time instead do you? would b v v v useful for GTD stuff.

Thanks.  Unfortunately, I don't know of a way to get the keys to type macros, which is what it sounds like you were wanting.  That would be cool.

The good news is that there's a way to make hotkeys that can do command lines.  That might be good enough for some applications.  This is where the shortcut of Ctrl+Alt+T for Terminal comes from.  Maybe something can be rigged up with the "xclip" program, to put content on the clipboard, then you can paste it from the clipboard by htiting another keystroke?  Anyway, here's the file:

/etc/X11/icewm/keys

There seems to be lots of useful things in here, have fun.  This only works for icewm (Easy mode).

It would be really cool if there was a feature somewhere that would let people define macros that they want the keys to insert, when typed.  Unfortunately, I don't know of any.  Anyone know of a way to do this?

Offline

 

#6 2008-02-06 6:00:37 am

ilox
Senior Member
From: Adelaide, South Australia
Registered: 2008-01-16
Posts: 244
Website

Re: Made Caps Lock key an additional Control

Many thanks Krellan, you're a lifesaver. I detest the Caps Lock key, it is an anachronism from the days of mechanical typewriters, yes, I can remember them and there simply isn't any justification for having it on the keyboard, none! sad

I dismantle that key on all my personal keyboards, now you have helped me dismantle it for this keyboard, this time without physically removing the key wink


Cheers, Ian
[ 4G EEE 701 7C, black case with white keyboard, 2Gb RAM, standard and 10400mAh batteries]
[was running Ubuntu Netbook-Remix 9.10 but didn't like it and l went back to eeebuntu 3.0 and love it! ]

Offline

 

#7 2008-10-03 6:45:14 am

RonaldP
Senior Member
From: Amsterdam, Netherlands
Registered: 2008-03-19
Posts: 573

Re: Made Caps Lock key an additional Control

I used this method on my 901 in Easy Mode to enable easy access on a English/UK keyboard to various accented characters that I need. It worked perfectly after removing gcin (equivalent to SCIM in earlier Eee PC software) to enable 'dead' keys.

However, this method appears to be broken after the recent system updates. I did a F9 restore, applied again all updates, removed again gcin, created again the 80xmodmap file in /etc/X11/Xsession.d/ and the the .Xmodmap file is still in /home/user/

It does not work.

I did

Code:

sh -e -x /etc/X11/Xsession.d/80xmodmap

and that worked fine. But it does not work at startup.

I changed 80xmodmap to 999xmodmap, but it still does not work at startup. Now what? Make it a startup script?

Last edited by RonaldP (2008-10-03 6:47:39 am)


901, 4GB SSD + 64GB RunCore SATA SSD (in place of the original 16GB SSD), BIOS 2103
Ubuntu 9.04 NBR on the 64GB SSD + Array.org kernel 2.6.28-12-netbook-eeepc +  eee-control for Jaunty
Intel Core 2 Duo iMac Leopard, PowerBook G4 Tiger, PowerBook 5300 Mac OS 8.6, Apple Airport WiFi network WPA/WPA2

Offline

 

Board footer

Powered by PunBB 1.2.15
© Copyright 2002–2005 Rickard Andersson