Subject: misc/12760: wscons keyboard maps
To: None <gnats-bugs@gnats.netbsd.org>
From: None <sborrill@precedence.co.uk>
List: netbsd-bugs
Date: 04/26/2001 17:19:57
>Number:         12760
>Category:       misc
>Synopsis:       The wscons startup scripts don't allow for configuration of keyboard map
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    misc-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Apr 26 09:24:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Stephen Borrill
>Release:        1.5 release and -current
>Organization:
Precedence Technologies Ltd
>Environment:
	
System: NetBSD cats 1.5 NetBSD 1.5 (CATSFW192) #3: Thu Apr 26 16:42:34 BST 2001 root@cats:/usr/src/sys/arch/arm32/compile/CATSFW192 arm32


>Description:
/etc/rc.d/wscons does not have the capability to alter any options with
wsconsctl which includes keyboard mappings. To set up keyboard mappings you
need to manually add wsconsctl commands to /etc/rc.local or such like.
>How-To-Repeat:
Get a UK keyboard. Try and type a #, you get \, etc.
>Fix:
Alter /etc/rc.d/wscons to add capability to set keyboard mappings based on
settings in /etc/wscons.conf. The attached patch will understand lines such
as:
encoding	uk
keysym		Control_L	Caps_Lock

In addition, I've included a patch which adds an example and some comments
to /etc/wscons.conf

--- etc/rc.d/wscons.orig	Fri Jan 12 17:26:06 2001
+++ etc/rc.d/wscons	Thu Apr 26 14:27:29 2001
@@ -17,6 +17,7 @@
 {
 	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=
@@ -121,6 +122,19 @@
 						cmd="$cmd -k $kbd"
 						;;
 				esac
+				eval $DOIT $cmd
+				;;
+			encoding)
+				map=$arg1
+				cmd=$wsctl
+				cmd="$cmd -w encoding='$map'"
+				eval $DOIT $cmd
+				;;
+			keysym)
+				from=$arg1
+				to=$arg2
+				cmd=$wsctl
+				cmd="$cmd -w map+='keysym $from = $to' > /dev/null"
 				eval $DOIT $cmd
 				;;
 			mux)

--- wscons.conf.orig	Fri Jan 12 17:25:01 2001
+++ wscons.conf	Thu Apr 26 17:18:52 2001
@@ -27,4 +27,12 @@
 #screen	5	80x50	vt100
 
 #keyboard	auto
+
+# Alter the 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) for more details
+#encoding	uk
+#keysym		Control_L Caps_Lock
+
 mux		1
>Release-Note:
>Audit-Trail:
>Unformatted: