Subject: misc/13937: Belgian keyboard map
To: None <gnats-bugs@gnats.netbsd.org>
From: None <chrisp@belgacom.net>
List: netbsd-bugs
Date: 09/12/2001 18:55:26
>Number:         13937
>Category:       misc
>Synopsis:       Patch to add "be" keyboard support
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 12 09:58:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Chris Pockele <chrisp@belgacom.net>
>Release:        NetBSD 1.5.1
>Organization:
BSDaemon - http://www.BSDaemon.be/ - Flemish BSD support site
	
>Environment:
	NetBSD 1.5.1 (release), i386 arch 
System: NetBSD 1.5.1 NetBSD 1.5.1 (BLACKLODGE) #1: Sun Sep 9 12:26:22 CEST 2001 root@:/usr/src/sys/arch/i386/compile/BLACKLODGE i386


>Description:
	The NetBSD 1.5 release has no support for the Belgian keyboard.
I put the be keymap from OpenBSD into the wscons driver.
Tested on i386 architecture.

>How-To-Repeat:
	Try to use a Belgian keyboard :-).
>Fix:
	Here's a patch of the files in /sys that had to be changed for be
keyboard support, against the files in the -current tree (MAIN branch,
wskbdmap_mfii.c v1.20 and wsksymdef.h v1.39).
(My personal opinion: wouldn't it be better for both NetBSD and OpenBSD
to keep these files a bit in sync, to make it easy to add more keymaps,
the wheel shouldn't be reinvented every time someone wants to add one.)



diff -ru current/dev/pckbc/wskbdmap_mfii.c sys/dev/pckbc/wskbdmap_mfii.c
--- current/dev/pckbc/wskbdmap_mfii.c	Sun Sep  9 11:09:59 2001
+++ sys/dev/pckbc/wskbdmap_mfii.c	Sun Sep  9 11:28:47 2001
@@ -457,6 +457,39 @@
     KC(53), 			KS_z,
 };
 
+static const keysym_t pckbd_keydesc_be[] = {
+/*  pos      normal             shifted         altgr           shift-altgr */
+    KC(2),   KS_ampersand,      KS_1,           KS_bar,
+    KC(3),   KS_eacute,         KS_2,           KS_at,
+    KC(4),   KS_quotedbl,       KS_3,           KS_numbersign,
+    KC(5),   KS_apostrophe,     KS_4,
+    KC(6),   KS_parenleft,      KS_5,
+    KC(7),   KS_currency,       KS_6,           KS_asciicircum,
+    KC(8),   KS_egrave,         KS_7,
+    KC(9),   KS_exclam,         KS_8,
+    KC(10),  KS_ccedilla,       KS_9,           KS_braceleft,
+    KC(11),  KS_agrave,         KS_0,           KS_braceright,
+    KC(12),  KS_parenright,     KS_degree,
+    KC(13),  KS_minus,          KS_underscore,
+    KC(16),  KS_a,
+    KC(17),  KS_z,
+    KC(26),  KS_dead_circumflex, KS_dead_diaeresis, KS_bracketleft,
+    KC(27),  KS_dollar,         KS_asterisk,    KS_bracketright,
+    KC(30),  KS_q,
+    KC(39),  KS_m,
+    KC(40),  KS_ugrave,         KS_percent,     KS_section,
+    KC(41),  KS_twosuperior,
+    KC(43),  KS_mu,             KS_sterling,    KS_grave,
+    KC(44),  KS_w,
+    KC(50),  KS_comma,          KS_question,
+    KC(51),  KS_semicolon,      KS_period,
+    KC(52),  KS_colon,          KS_slash,
+    KC(53),  KS_equal,          KS_plus,        KS_asciitilde,
+    KC(86),  KS_less,           KS_greater,     KS_backslash,
+    KC(184), KS_Mode_switch,    KS_Multi_key,
+};
+
+
 static const keysym_t pckbd_keydesc_swapctrlcaps[] = {
 /*  pos      command		normal		shifted */
     KC(29), 			KS_Caps_Lock,
@@ -510,6 +543,8 @@
 	KBD_MAP(KB_US | KB_IOPENER | KB_SWAPCTRLCAPS,	KB_US | KB_IOPENER,
 		pckbd_keydesc_swapctrlcaps),
 	KBD_MAP(KB_ES ,			KB_US,	pckbd_keydesc_es),
+        KBD_MAP(KB_BE,                  KB_US,  pckbd_keydesc_be),
+        KBD_MAP(KB_BE | KB_SWAPCTRLCAPS, KB_BE, pckbd_keydesc_swapctrlcaps),
 	KBD_NULLMAP(KB_US | KB_MACHDEP,	KB_US),
 	KBD_NULLMAP(KB_JP | KB_MACHDEP,	KB_JP),
 	KBD_NULLMAP(KB_US | KB_MACHDEP | KB_SWAPCTRLCAPS,
diff -ru current/dev/wscons/wsksymdef.h sys/dev/wscons/wsksymdef.h
--- current/dev/wscons/wsksymdef.h	Sun Sep  9 11:07:09 2001
+++ sys/dev/wscons/wsksymdef.h	Sun Sep  9 11:32:09 2001
@@ -487,6 +487,7 @@
 #define KB_NO			0x0a00
 #define KB_ES			0x0b00
 #define KB_HU			0x0c00
+#define KB_BE                   0x0d00
 
 #define KB_NODEAD		0x0001
 #define KB_DECLK		0x0002	/* DEC LKnnn layout */
@@ -509,7 +510,8 @@
 	{ KB_SV,	"sv" }, \
 	{ KB_NO,	"no" }, \
 	{ KB_ES,	"es" }, \
-	{ KB_HU,	"hu" }
+	{ KB_HU,	"hu" }, \
+        { KB_BE,        "be" }
 
 #define KB_VARTAB \
 	{ KB_NODEAD,	"nodead" }, \
>Release-Note:
>Audit-Trail:
>Unformatted: