DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Customizing device character mapping

Using strchg to load the KBD module

To use the KBD module, it must first be pushed onto the STREAM using the strchg command. Before you reconfigure the STREAM, the command strconf shows the modules on the current STREAM.

   $ strconf
   kbd
   asy
As the KBD module must be placed below the line discipline module, ldterm, all terminal settings are lost when reconfiguring the STREAM. The shell script shown above provides a way of preserving the terminal line discipline settings.


NOTE: This shell script is only suitable for terminals that have the STREAMS configuration as shown above. If your STREAMS module configuration is different, then the script should be altered accordingly.

   #  Sample shell script to reconfigure the current STREAM
   #  to use the KBD module. (Does not work for the console).
   stty -g > stty_settings
   strchg -p
   strchg -h kbd
   strchg -h ldterm
   stty `cat stty_settings`
   rm -f stty_settings

Shell script to reconfigure a STREAM

Explanation of shell script:


stty -g > stty_settings
records the current terminal settings in the file stty_settings in a form which can be used as input for another stty(1) call.

strchg -p
pop the ldterm module from the current STREAM.

strchg -h kbd
push the kbd module onto the current STREAM.

strchg -h ldterm
push the ldterm module back onto the current STREAM.

stty `cat stty_settings`
reset the terminal settings using those stored earlier.

rm -f stty_settings
remove the terminal settings file.
After you have run the shell script, strconf will now show you the new module configuration on the current STREAM:
   $ strconf
   ldterm
   kbd
   asy


NOTE: This shell script is only correct for a serial line terminal with no additional STREAMS modules configured. It may be necessary to alter the shell script if you have other modules configured.


Next topic: Using kbdload and kbdset to load and configure KBD maps
Previous topic: User interface to the KBD module

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 22 April 2004