Re: Key mapping in X Windows


Subject: Re: Key mapping in X Windows
From: Michael A. Peters (Moonglue@141.com )
Date: Mon Aug 14 2000 - 17:07:00 MDT


As far as backspace/delete goes- this script should do it- copy it
into a text file called whatever and run

sh whatever

#!/bin/sh
cd ~
xmodmap -pke > xmod.full
grep BackSpace xmod.full > .xmodmaprc
grep Delete xmod.full >> .xmodmaprc

sed -e "s/BackSpace/temp/g" < .xmodmaprc > .xmodmaprc.-
sed -e "s/Delete/BackSpace/g" \
-e "s/temp/Delete/g" < .xmodmaprc.- > .xmodmaprc
xmodmap ~/.xmodmaprc
rm -f xmod.full .xmodmaprc.-
# End Script

Now, open up the gnome configuration tool (sorry- I'm not familiar
with kde) and scroll down to session, and choose Startup Programs

hit the add button and add:

xmodmap /home/yourusername/.xmodmaprc

Don't worry about the priority, it don't matter.
-=-=-=-
What this does:
xmodmap is a program for displaying/modifying your keytable map.
xmodmap -pke prints the current keytable.
The two grep commands gets the two items you are interested in
(BackSpace and Delete)
The sed commands swaps them.
xmodmap ~/.xmodmaprc immediately loads the alternate keytable commands.
adding xmodmap /home/yourusername/.xmodmaprc to the gnome session
startup will swap them every time you startx (for that user).

###
# MOUSE
###

You can get a really nice optical Logitech USB three button mouse for
about $30.00
Never worry about dirty mouse balls, never worry about emulating three buttons.
That's what I *highly* recommend for the mouse, seriously.

I love my optical mouse- and they are inexpensive, and work with Mac OS too.
I personally don't know how to set up emulation of 2nd 3rd buttons
using numlock. I do know that xpmac hard codes alt-f2 as 2nd and
alt-f3 as third, if you use xpmac.

>i went to yellow dog's site and then to the site they told me to
>which is http://people.a2000.nl/omoerbe/ to figure out how to map my
>keys correctly so they will work 3 buttons for a 1 button usb mouse.
>after i did that, i couldn't get the keys to work nor could i get
>the delete key to do backspace. could someone please tell me what
>to chagne to get this to work

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Michael A. Peters-- http://24.5.29.77/Linux_Pages/
                                http://www.omnilinux.com/
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  



This archive was generated by hypermail 2a24 : Tue Aug 15 2000 - 02:10:13 MDT