Subject: kern/30041: Add USB Portuguese keymap from OpenBSD
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Rui Paulo <rpaulo@netbsd-pt.org>
List: netbsd-bugs
Date: 04/23/2005 15:36:00
>Number:         30041
>Category:       kern
>Synopsis:       Add USB Portuguese keymap from OpenBSD
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Apr 23 15:36:00 +0000 2005
>Originator:     Rui Paulo <rpaulo@netbsd-pt.org>
>Release:        NetBSD 3.0_BETA
>Organization:
>Environment:
System: NetBSD proton.fnop.net 3.0_BETA NetBSD 3.0_BETA (PROTON) #1: Thu Mar 24 20:38:18 WET 2005 rpaulo@proton.fnop.net:/home/rpaulo/netbsd/obj/sys/arch/i386/compile/PROTON i386
Architecture: i386
Machine: i386
>Description:
Manuel Pata recently asked to add support for USB Portuguese (pt_PT) keyboards
under OpenBSD. We should add it too by porting it from OpenBSD. Below is a
patch for ukbdmap.c with whitespacing/tabs corrected.
>How-To-Repeat:
wsconsctl -w encoding=pt with an USB keyboard
>Fix:
Index: ukbdmap.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/ukbdmap.c,v
retrieving revision 1.13
diff -u -r1.13 ukbdmap.c
--- ukbdmap.c	11 Sep 2004 04:47:43 -0000	1.13
+++ ukbdmap.c	23 Apr 2005 15:31:19 -0000
@@ -433,6 +433,32 @@
     KC(230), KS_Mode_switch,	KS_Multi_key,
 };
 
+Static const keysym_t ukbd_keydesc_pt[] = {
+/*  pos      normal		shifted		altgr		shift-altgr */
+    KC(31),  KS_2,		KS_quotedbl,	KS_at,
+    KC(32),  KS_3,		KS_numbersign,	KS_sterling,
+    KC(35),  KS_6,		KS_ampersand,
+    KC(36),  KS_7,		KS_slash,	KS_braceleft,
+    KC(37),  KS_8,		KS_parenleft,	KS_bracketleft,
+    KC(38),  KS_9,		KS_parenright,	KS_bracketright,
+    KC(39),  KS_0,		KS_equal,	KS_braceright,
+    KC(45),  KS_apostrophe,	KS_question,
+    KC(46),  KS_plus,		KS_asterisk,
+    KC(47),  KS_plus,		KS_asterisk,
+    KC(48),  KS_dead_acute,	KS_dead_grave,
+    KC(49),  KS_less,		KS_greater,
+    KC(50),  KS_dead_tilde,	KS_dead_circumflex,
+    KC(51),  KS_ccedilla,	KS_Ccedilla,
+    KC(52),  KS_masculine,	KS_ordfeminine,
+    KC(53),  KS_backslash,	KS_bar,
+    KC(54),  KS_comma,		KS_semicolon,
+    KC(55),  KS_period,		KS_colon,
+    KC(56),  KS_minus,		KS_underscore,
+    KC(100), KS_less,		KS_greater,
+    KC(226), KS_Mode_switch,	KS_Multi_key,
+    KC(230), KS_Mode_switch,	KS_Multi_key,
+};
+
 Static const keysym_t ukbd_keydesc_sg[] = {
 /*  pos      normal		shifted		altgr		shift-altgr */
     KC(30),  KS_1,		KS_plus,	KS_bar,
@@ -498,6 +524,7 @@
 	KBD_MAP(KB_NO,			KB_DK,	ukbd_keydesc_no),
 	KBD_MAP(KB_NO | KB_NODEAD,	KB_NO,	ukbd_keydesc_no_nodead),
 	KBD_MAP(KB_ES ,			KB_US,	ukbd_keydesc_es),
+	KBD_MAP(KB_PT,			KB_US,	ukbd_keydesc_pt),
 	KBD_MAP(KB_SG,			KB_US,	ukbd_keydesc_sg),
 	KBD_MAP(KB_SG | KB_NODEAD,	KB_SG,	ukbd_keydesc_sg_nodead),
 	KBD_MAP(KB_SF,			KB_SG,	ukbd_keydesc_sf),