(Answer) (Category) Linux on PowerPC FAQ-O-Matic : (Category) X Windows :
My BackSpace and forward-delete keys are mapped the wrong way around. How do i get them to work normally?
You can use xmodmap to swap the two keys. I have the following in my .xsession:

  xmodmap -e "keycode 59 = BackSpace"
  xmodmap -e "keycode 125 = Delete"

This makes Emacs, Netscape, and most other X programs happy. However, it breaks
xterms; to fix them, I put the following in my .bashrc:

  if [ ${TERM} = "xterm" ]; then stty erase "^H"; fi

With these two fixes, everything's happy on my box.

-- Reid Priedhorsky <rpriedhorsky@macalester.edu>


For me, different X programs seem to interpret the keys differently.
So I find it useful to make two scripts.. one with 59 = BackSpace,
125 = Delete, and the other with 59 = Delete, 125 = BackSpace.
Then I can just type one command to switch back and forth.

Better yet, I've editted my fvwm rc file to map those programs to F-keys
so I can easily switch on the fly.

-- Kenneth Lu <kenlu@mit.edu>
freeze@newwave.net, kenlu@mit.edu, rpriedhorsky@macalester.edu
I've also found that if it doesn't work to add xmodmap -e lines to the .xsession file, create
a file called .Xmodmap (in your home directory) and write this (exactly):

keycode 59 = BackSpace
keycode 125 = Delete

Make sure you don't put them in quotes or have "xmodmap -e" in front of them.

--Jason.....JJ
jmott@auragen.com
Depending on how your X startup sequence works, you might have better luck putting the xmodmap -e commands in your ~/.xinitrc file. (Depending on whether or not you have certain startup files, and the order in which startx, e.g. looks for them.)

Also, if you're putting the xmodmap commands into a startup script like .xinitrc, don't forget to insert them before the call to the window manager! I wasted some time barking up all the wrong trees before I figured this out. My .xinitrc is like this:

xmodmap -e "keycode 59 = BackSpace"
xmodmap -e "keycode 125 = Delete"
/opt/bin/enlightenment -theme /opt/enlightenment/themes/sick.etheme
admin@yawny.com
To change the mappings of your keys, specifically the "Delete" and
"BackSpace" keys  is a relatively involved process.
1.  Become su.
2.  Enter 'showkey -k'
3.  
a) Depress the "BackSpace" key (aka "delete" on Mac keybboards)and note the number.
b) Depress the "Delete" key (aka "del" on Mac keyboards) and note the number.
  My output looked like:
  
# showkey -k
keycode  42 press     [this is the BackSpace]
keycode  42 release
keycode  76 press     [this is the Delete]
keycode  76 release

4. Now to get the proper keymaps for Xwindows type 'xmodmap -pk' as your
normal user.
  My output looked like:

% xmodmap -pk
There are 4 KeySyms per KeyCode; KeyCodes range from 8 to 134.

    KeyCode     Keysym (Keysym) ...
    Value       Value   (Name)  ...

      8         0x0061 (a)      0x0041 (A)      
      9         0x0073 (s)      0x0053 (S)
      .
      .
      . 
     50         0xff08 (BackSpace)      0x1004ff08 (osfBackSpace) [delete]
      .
      .
      . 
     84         0xff08 (BackSpace)      0x1004ff08 (osfBackSpace) [del]
      .
      .
      .
      
5.  Now type in the commands:

xmodmap -e "keycode 50 = BackSpace osfBackSpace"
xmodmap -e "keycode 84 = Delete"

6.  As I haven't figured out where to put these I've got them temporarily in
my .tcshrc directory.  I think that the number that we obtained in step 3
are for the terminal interface, while the numbers that we obtained in step 4
are for Xwindows.  Thus before the Xwindows manager is launched, what we
obtained in step 3 need to be entered.  Once the windows manager is
launched,the values obtained in step 4 need to be implimented.

7.  For those who don't have a full keyboard or don't want to deal with
modifying your keymap, there is an easier solution.  Just enter:

xmodmap  -e "keysym Delete = BackSpace osfBackSpace"

Cal Abel
crabel@students.wisc.edu or
crabel99@aol.com
crabel@students.wisc.edu
To change the key mappings globally on Debian machines (and maybe RedHat based
distributions) uncomment the lines below the Macintosh section in /etc/X11/Xmodmap.

If you are using gdm, you may want to copy the lines using
Xmodmap from /etc/gdm/Session/Gnome to /etc/gdm/Init/Default.
ningerso@d.umn.edu
I had this problem on my powerbook "bronze".  I found that the source of it was that the keyboard
 setting in /etc/X11/XF86Config was set to a PC keyboard.  To change this first 
make sure that you have a file called "macintosh" in the /usr/X11R6/lib/X11/xkb/keymap/ 
folder (this is a special keyboard file). Then set the keyboard section of XF86Config to look like this:

XkbKeymap "macintosh"
Xkbkeycodes "macintosh"
XkbTypes "types/default"
XkbCompat "compat/default"
XkbSymbols "symbols/us(pc101)"
XkbGeometry "macintosh"

Hope this helps.
fsteen19@idt.net
THE ABOVE FOUR SOLUTIONS DID NOT WORK (although I do appreciate the input).

I'm using a PowerMac 8500 as a router - LinuxPPC 2000 Q4. It has had an ADB and/or USB keyboard attached. Both keyboards treated the BackSpace key like a forward delete key in GNOME (but not when I don't start X)...

After several days of digging, I'd like to share what I discovered so you won't have to spend as much time researching as I did. I'm a high school teacher, so I'll try to write this with the assumption that you know very little about Linux.

First, to check that you have a similar setup as I do, open a terminal window (you may have to eventually "su" if not logged in as root). Use the command
# showkey
(NOTE that # before showkey represents the command prompt - don't type it!)
- Hit your backspace (i.e. left-delete <<) key. If your keyboard is like every one I've tried, then you'll see:
keycode 51 press
keycode 51 release

If you don't see this, then I doubt the following steps will help you, although they might give you some insight. My solution involves modifying the keymap text file (very easy) to make the BackSpace key work properly. It should fix things for all applications that don't have their own backspace key setting (in which case those apps can be easily fixed by changing preferences, if needed... although I haven't discovered any apps that don't work yet).

Steps to fix your keymap (you should still be in your terminal window):
(NOTE that # represents the command prompt - don't type it!)

1.) Change to the directory that contains the keymaps:
# cd /usr/lib/kbd/keymaps/mac

2.) Check out what's in there. I found mac-us-ext.kmap.gz to be the most appropriate description of my keyboard. All the files with the .gz extension need to be unzipped to edit them. But first, make a backup copy:
# cp mac-us-ext.kmap.gz mac-us-custom.kmap.gz
# gunzip -v mac-us-custom.kmap.gz

3.) Next, open the file in a text editor (I'm using vi, but you can use whatever you're familiar with.
# vi mac-us-custom.kmap

[NOTE: You can accomplish all of the above steps through the GUI file manager by navigating to /usr/lib/kbd/keymaps/mac, make a copy of "mac-us-ext.kmap.gz" called "mac-us-custom.kmap.gz", then right-click on it and select "Extract" to unzip it. Next, right-click on your extracted copy, "mac-us-custom.kmap", and select "Edit". The rest of the instructions will be command line, but you can use the GUI for most of them as well...]

4.) Scroll down in "mac-us-custom.kmap" until you find the line that says:
keycode  51 = Delete         Delete
and change it to
keycode  51 = BackSpace      BackSpace
** Be sure to capitalize the S in BackSpace, or it won't work! **

5.) Save the file and quit the text editor. I didn't have to re-zip my copy, although I'm unsure what the consequences might be... It seems to work fine as just 
mac-us-custom.kmap

6.) You have to edit one more file in /etc/sysconfig to tell your X to use the new keymap. I always make a backup copy first:
# cd /etc/sysconfig/
# cp keyboard keyboard.bak
Open the keyboard file with your preferred text editor. I prefer BBEdit (not an option), but vi works:
# vi keyboard

7.) Change the KEYTABLE line from something like:
KEYTABLE="mac-us-ext"
to:
KEYTABLE="mac-us-custom"

8.) Save, exit and reboot.
# reboot

That did it for me... Believe me, i tried lots of stuff.
The previous suggestion for modifying /etc/X11/XF86Config works just for the current session -- unless your system doesn't run XAutoconfig at boot (like most setups do, I presume). XAutoconfig writes over your changes to XF86Config.

Much thanks to the article at:
http://www.geocrawler.com/archives/3/2/1999/7/0/2489688/
help@eastside.org
I ran into the same problem with Debian on a Powerbook 2000.  The problem is with the Console key mapping, not X.  This can still be fixed with the keymap, but Debian has a different configuration scheme. As root:

cd /usr/share/keymaps/mac

Create mac-us-custom.kmap as described above.

cd /usr/sbin
kbdconfig
Type: n <RETURN>
Warning: If you don't type this right, kbdconfig will reset the keyboard to an unusable state.

From there, things are self-explanatory.  You'll have to restart X before the changes take effect.
treluga@u.washington.edu
[Append to This Answer]
Previous: (Answer) Anchor text in Mosaic is white when running Afterstep on MkLinux
Next: (Answer) How do I set up tkdesk to work with tcl7.6?
This document is: http://www.jonh.net/cgi-bin/lppcfom/fom?file=83
[Search] [Appearance]
This is a Faq-O-Matic 2.717d.
Hosted by anduin.org and SourceForge Logo