Creating an International USB Keymap for the Text Console

  1.  Copy the US USB keymap (usb-us.map.gz) from /usr/lib/kbd/keymaps/usb into your home directory
  2.  Copy the international keymap for your layout from /usr/lib/kbd/keymaps/macintosh. In this file you'll find the necessary key symbols for the next steps.
  3. Unzip the USB US layout with gunzip -f usb-us.map.gz
  4. Modify the layout using Fig. 1 below, and save it as usb-xx.map, where xx is the abbreviation for your layout.
  5. Copy the layout to /usr/lib/kbd/keymaps/usb
  6. Zip it with gzip -f filename, e.g. gzip -f usb-sg.map for a Swiss German layout.
  7. Change the file /etc/sysconfig/keyboard to contain the line KEYTABLE="filename", i.e. KEYTABLE="usb-sg" for the Swiss German variety. Save the file.
  8. Issue the command /etc/rc.d/init.d/keytable restart to load the new keytable.

You can download the Swiss German keymap to see an example. It isn't perfect but quite useable.

 

Fig 1.

These are the keycodes for the G3 USB keyboard in text mode. The codes are given in hexadecimal. Please tell me if you know the keycode for the key next to the left Shift key. The keycode for the equal sign on the keypad seems to be 67. Conformation highly welcome :-)

 

 

Creating an USB xmodmap for X-Window

Getting the USB keyboard working in X-Window was a bit harder. To my knowledge there isn't any USB related xmodmap in the distribution. Strangely enough if I connected an ADB keyboard to my b&w G3, it worked flawlessly (US layout though) but the USB keyboard takes much less of my already cramped (physical) desktop. Fortunately there is a program called xev, which gives you the keycodes and other events. It needs a running X-Window system and should be started from an xterm, so you can see its output.

You can download my Swiss German xmodmap to get started.

 

  1. Copy my xmodmap.usb-sg into your home directory for modification. I zipped it to prevent LF conversion so you'll have to unzip it first: gunzip -f xmodmap.usb-sg.gz
  2. Copy the international keymap for your layout from /usr/lib/kbd/keymaps/macintosh. In this file you'll find the necessary key symbols. They seem to differ sometimes from the ones used in the text console keymaps though.
  3. Modify the xmodmap.usb-sg layout using Fig. 2 below, and save it as xmodmap.usb-xx, where xx is the abbreviation for your layout.
  4. Copy to the new layout to /usr/X11R6/lib/X11/xinit/ as .Xmodmap (don't forget the dot at the beginning). Next time you start, the new layout should be in effect systemwide. If you prefer to apply it only to your own Linux account, put the .Xmodmap into your home directory.

 

Fig 2.

These are the keycodes for the G3 USB keyboard in X-Window (Xpmac driver). M2 and M3 are the extra mouse buttons. The codes are given in decimal. If you have information to fill the gaps, please tell me!

 

 


Created and maintained by Urs Hochstrasser -- Last Update: 4-Jun-99


Apple, the Apple Logo and Power Macintosh G3 are trademarks of Apple Computer, Inc. This site has no affiliation, actual or implied, with Apple Computer Inc. or Terra Soft Solutions, Inc. It exists to provide information on using Apple's Blue & White G3 computer with the Linux distribution Yellow Dog Linux. All other trademarks are the property of their respective holders.