Subject: port-macppc/30126: support for Portuguese ADB keyboards
To: None <port-macppc-maintainer@netbsd.org, gnats-admin@netbsd.org,>
From: Rui Paulo <rpaulo@netbsd-pt.org>
List: netbsd-bugs
Date: 05/03/2005 22:52:00
>Number:         30126
>Category:       port-macppc
>Synopsis:       support for Portuguese ADB keyboards
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    port-macppc-maintainer
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue May 03 22:52:00 +0000 2005
>Originator:     Rui Paulo <rpaulo@netbsd-pt.org>
>Release:        NetBSD 3.0_BETA
>Organization:
>Environment:
System: NetBSD matter.fnop.net 3.0_BETA NetBSD 3.0_BETA (GENERIC) #0: Wed Apr 13 18:53:31 WEST 2005 rpaulo@matter.fnop.net:/home/rpaulo/obj/sys/arch/macppc/compile/GENERIC macppc
Architecture: powerpc
Machine: macppc
>Description:
	Portuguese ADB keyboards aren't supported by NetBSD, yet. This patch
	adds support for them in mac68k and macppc ports as they share the
	same adb keyboard support code. This was tested by me in 3.0_BETA
	and there should be no problems supporting this in HEAD as the
	file revision is the same (and nothing has really changed in
	HEAD regarding to ADB that could affect this). If possible, 
	please ask for pullups for NetBSD 2.1 and 3.0.

	P.S.: Tested by Nuno Teixeira on NetBSD/mac68k on his very limited
	keyboard.
>How-To-Repeat:
	wsconsctl -w encoding=pt on macppc/mac68k
>Fix:
Index: akbdmap.h
===================================================================
RCS file: /cvsroot/src/sys/arch/mac68k/dev/akbdmap.h,v
retrieving revision 1.6
diff -u -r1.6 akbdmap.h
--- akbdmap.h	30 Oct 2004 20:13:15 -0000	1.6
+++ akbdmap.h	3 May 2005 22:33:28 -0000
@@ -382,6 +382,31 @@
     KC(58),	KS_Mode_switch, KS_Multi_key,		/* Option */
 };
 
+static const keysym_t akbd_keydesc_pt[] = {
+/*  pos         normal          shifted         altgr           shift-altgr */
+    KC(7),	KS_x,		KS_X,		KS_guillemotleft, KS_guillemotright,
+    KC(10),	KS_section,	KS_plusminus,
+    KC(19),	KS_2,		KS_quotedbl,	KS_at,
+    KC(20),	KS_3,		KS_numbersign,	KS_sterling,
+    KC(22),	KS_6,		KS_ampersand,
+    KC(24),	KS_plus,	KS_asterisk,
+    KC(25),     KS_9,		KS_parenright,	KS_bracketright, KS_braceright,
+    KC(26),	KS_7,		KS_slash,
+    KC(27),	KS_apostrophe,	KS_question,
+    KC(28),	KS_8,		KS_parenleft,	KS_bracketleft, KS_braceleft,
+    KC(29),	KS_0,		KS_equal,
+    KC(30),	KS_dead_acute,	KS_dead_grave,
+    KC(33), 	KS_masculine,	KS_ordfeminine,
+    KC(39),	KS_dead_tilde,	KS_dead_circumflex,
+    KC(41),	KS_ccedilla,	KS_Ccedilla,
+    KC(43),	KS_comma,	KS_semicolon,
+    KC(44),	KS_minus,	KS_underscore,
+    KC(47),	KS_period,	KS_colon,
+    KC(50),	KS_less,	KS_greater,
+    KC(58),	KS_Mode_switch,
+    KC(81),	KS_KP_Equal,
+};
+
 #define KBD_MAP(name, base, map) \
 			{ name, base, sizeof(map)/sizeof(keysym_t), map }
 
@@ -397,6 +422,7 @@
 	KBD_MAP(KB_DE | KB_NODEAD,	KB_DE,  akbd_keydesc_de_nodead),
 	KBD_MAP(KB_UK,			KB_US,  akbd_keydesc_uk),
 	KBD_MAP(KB_ES,			KB_US,	akbd_keydesc_es),
+	KBD_MAP(KB_PT,                  KB_US,  akbd_keydesc_pt),
 	{0, 0, 0, 0}
 };