Add support for selection of a kernel builtin keymap and/or a userspace

keymap file to wscons.conf.
Follows PR misc/12760 by Stephen Borrill, but uses the external keymap
file instead of individual key entries in wscons.conf. This saves a lot
of editing work if the map has to be switched.
This commit is contained in:
drochner 2001-05-02 15:14:02 +00:00
parent dfd2b177e1
commit 2b60c3bb4f
2 changed files with 37 additions and 2 deletions

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $NetBSD: wscons,v 1.6 2000/09/19 13:04:39 lukem Exp $
# $NetBSD: wscons,v 1.7 2001/05/02 15:14:03 drochner Exp $
#
# PROVIDE: wscons
@ -17,6 +17,7 @@ wscons_start()
{
wscfg=/usr/sbin/wsconscfg
wsfld=/usr/sbin/wsfontload
wsctl=/sbin/wsconsctl
config=/etc/wscons.conf
usage="Usage: wsconfig [-n] [-f configfile] [-font fontpgm] [-screen screenpgm]"
DOIT=
@ -123,6 +124,28 @@ wscons_start()
esac
eval $DOIT $cmd
;;
encoding)
map=$arg1
cmd=$wsctl
cmd="$cmd -w \"encoding=$map\""
eval $DOIT $cmd
;;
mapfile)
mapfile=$arg1
( while read entry; do
case "$entry" in
\#*|"")
continue
;;
*)
cmd=$wsctl
cmd="$cmd -w \"map+=$entry\""
cmd="$cmd >/dev/null"
eval $DOIT $cmd
;;
esac
done ) < $mapfile
;;
mux)
cmd="$wscfg -m $arg1"
eval $DOIT $cmd

View File

@ -1,4 +1,4 @@
# $NetBSD: wscons.conf,v 1.7 2000/12/31 01:22:14 david Exp $
# $NetBSD: wscons.conf,v 1.8 2001/05/02 15:14:02 drochner Exp $
#
# workstation console configuration
@ -27,4 +27,16 @@ screen 4 - -
#screen 5 80x50 vt100
#keyboard auto
# Select a kernel builtin keyboard map by uncommenting the following line and
# altering the country code to your requirements
# (choose from user, us, uk, de, dk, it, fr, uk, jp, sv, no, es).
# See wsconsctl(8), pckbd(4), ukbd(4) etc. for more details.
#encoding sv
# Redefine individual keys from a file containing "keysym" and/or "keycode"
# entries.
# See wsconsctl(8) for more details.
#mapfile /usr/share/wscons/keymaps/pckbd.sv.svascii
mux 1