Getting a Keyboard to Work in Text Mode

The loadkeys program loads a keymap that modifies the kernel's mapping of scan codes to key codes. You normally pass the name of a mapping file to this program; if you omit a mapping filename, the program uses a default mapping. Most distributions call loadkeys as part of the system startup process, as summarized in Table 3.1.

Table 3.1: Keymap Configuration Files

Distribution

loadkeys Called from

Default Keymap Specified in

Keymap File Storage Directory

Debian

/etc/init.d/keymap.sh

/etc/init.d/keymap.sh

/etc/console and /usr/share/keymaps

Mandrake

/etc/rc.d/rc.sysinit and /etc/rc.d/init.d/keytable

/etc/sysconfig/keyboard

/usr/lib/kbd/keymaps

Red Hat

/etc/rc.d/rc.sysinit and /etc/rc.d/init.d/keytable

/etc/sysconfig/keyboard

/lib/kbd/keymaps

Slackware

N/A

N/A

/usr/share/kbd/keymaps

SuSE

/etc/init.d/kbd

/etc/sysconfig/keyboard

/usr/share/kbd/keymaps

Most distributions point loadkeys directly at a keymap file in a subdirectory of the directory specified in the Keymap File Storage Directory column of Table 3.1. Debian is an oddball in this respect; when you install it, it copies a keymap file from /usr/share/keymaps to the/etc/console/bootttime.kmap.gz file. Slackware is even more odd; it doesn't call loadkeys at all during its boot process; it uses the default keymap and requires you to modify a startup file, such as /etc/rc.d/rc.local, if you want to load a custom keymap.

Even if your keymap is set up correctly, you may be vexed by peculiar keyboard repeat rate settings. If you find that too many or too few characters appear each second after you hold down a key for a brief period, then you need to adjust the keyboard repeat rate. You can do this with the kbdrate program, which takes rate and delay parameters, as shown here:

The rate (-r) setting is specified in characters per second, and the delay (-d) setting is specified in milliseconds. Thus, the preceding example sets the keyboard repeat rate at 12 characters per second after a 250ms (1/4-second) delay. This command must be typed by root, or it can be included in custom startup scripts. In fact, the script that calls loadkeys, as specified in Table 3.1, often calls kbdrate, so you can modify that call instead of creating a new one. Some distributions pass parameters in this file that are stored elsewhere, such as in /etc/sysconfig/keyboard.

0 0

Post a comment