kbmap [-i] [-1] [-g] [-n n] [d] [-e] [-m] [-a] [-t /dev/xxx] [file] -i = show index of available maps -q = query which table is currently in use -g = generate a key map table -n n = set keyboard to map 'n' mapping -d = set keyboard to normal mapping -e = set keyboard to <esc>N emacs mapping -m = set keyboard to meta (8bit) emacs mapping -a = do not convert <alt><ctl> and <alt><shf><ctl> -t /dev/xxx = apply map to this device file = use specified key map file
Kbmap reads a text file containg keyboard mapping information and set the keyboard to the selected mapping.
Kbmap can create a standard mapping file (/local/lib/kbmap.table) that contains the system default mapping as well as an two different emacs mapping that allow alt to be used as the emacs meta-key. Other keyboard mappings may be manually added to the kbmap.table file.
Only root may use this programme from the console.
It cannot be run from an rc2.d/xxx file or cron.
True META mapping (with 8th bit set) set with -m cannot be used with X11R2 (X11 does not use the standard keyboard maps). If you use X11R2 and the ascii console environments, the -e option should be used for emacs mapping simply to ensure that the .emacs files can be used in either mode without change.
If vtlmgr is used, then an attempt is made to identify which keyboard map is in use in spite of modifications made by vtlmgr.
If this mapping is used, the .emacs files should contain the following:
(define-key global-map "\M-N" 'ESC-prefix)
to enable the recognition of the new escape sequences.
The only significant change to the AT&T standard keyboard mapping is that the <alt><del> meta is enabled to allow backward-kill-word.
If this mapping is used, the .emacs files should contain the following:
(setq meta-flag t)
to enable the recognition 8th bit set meta characters.
X11R2 will not recognize 8th bit set characters. As a result, the -m option should not be used if you intend to run emacs with X11R2.
If the -a is used, then the gnuemacs C-M- sequences (such as C-M-s (isearch-forward-regexp)) cannot use the <alt><ctl><letter> combinations. Instead, the <esc> + <ctl><letter> sequence is used.
Create a basic keyboard mapping file that contains both the standard map and the emacs meta-key map:
kbmap -g kbmap.table
The current keyboard table is fetched. The current mapping information as described in the keymap_t structure is written to disk file kbmap.table. The meta-conversion for emacs is performed on the structure and the resulting information is appended to kbmap.table. The new information is NOT updated in the kernal.
Copy
kbmap.table
to
/local/lib/kbmap.table
(or other file as specified during system compilation.)
Any keyboard mapping may now be selected (using the default
file
/local/lib/kbmap.table):
kbmap -d = select default map kbmap -e = select emacs <esc>N<letter> map kbmap -m = select emacs <letter>|0x080 meta map
Alternatively, the key mapping may be selected by number:
kbmap -m 0 = select map 0 (default map) kbmap -m 1 = select map 1 (emacs <letter>|0x08 meta-map) kbmap -m 2 = select map 2 (normal <esc>N<letter> emacs) kbmap -m 3 = select map 3 (your additional) etc.
The changes made by kbmap are reset to system defaults whenever the system is booted. If permanent changes are needed, then the system default mapping in /etc/conf/pack.d/kd/Driver.o should be "zapped" with the appropriate table and the kernal rebuilt.
/local/lib/kbmap.table
Tony Field (tony%ajfcal@cpsc.ucalgary.ca, tony@ajfcal)