Subject: port-i386/12739: don't work some key of Japanese 106 USB Keyboard
To: None <gnats-bugs@gnats.netbsd.org>
From: None <hrs-t@hh.iij4u.or.jp>
List: netbsd-bugs
Date: 04/25/2001 01:13:23
>Number:         12739
>Category:       port-i386
>Synopsis:       don't work some key of Japanese 106 USB Keyboard
>Confidential:   yes
>Severity:       serious
>Priority:       medium
>Responsible:    port-i386-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 24 09:34:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Hiroshi TOMIE
>Release:        1.5-Release
>Organization:
Japan
	
>Environment:
	
System: NetBSD ikatuti 1.5 NetBSD 1.5 (IKATUTI) #3: Tue Apr 24 01:20:42 JST 2001 root@ikatuti:/usr/src/sys/arch/i386/compile/IKATUTI i386


>Description:
	NetBSD supports USB Keyboard, but Some Keys of Japanese USB Keyboard
	(So called 106 keyboard) don't work.
	The keys are underscore key which is left side of right shift key
	and bar key which is left side of backspace key.
	
>How-To-Repeat:
	Only plug Japanese USB Keyboard.
	
>Fix:
	The cause of this problem is lack of keymaps of Japanese USB Keyboard.
	Japanese Keyboard's keymaps is here. 
	(This is unified diff patch of dev/usb/ukbdmap.c)

--- ukbdmap.c.orig	Sun Feb 28 21:17:00 1999
+++ ukbdmap.c	Fri Dec 24 10:31:25 1999
@@ -154,6 +154,25 @@
     KC(231),			KS_Meta_R,
 };
 
+static const keysym_t ukbd_keydesc_jp[]= {
+/*  pos      normal             shifted         altgr           shift-altgr */
+    KC(31),  KS_2,              KS_quotedbl,
+    KC(35),  KS_6,              KS_ampersand,
+    KC(36),  KS_7,              KS_apostrophe,
+    KC(37),  KS_8,              KS_parenleft,
+    KC(38),  KS_9,              KS_parenright,
+    KC(39),  KS_0,
+    KC(45),  KS_minus,          KS_equal,
+    KC(46),  KS_asciicircum,    KS_asciitilde,
+    KC(47),  KS_at,             KS_grave,
+    KC(48),  KS_bracketleft,    KS_braceleft,
+    KC(51),  KS_semicolon,      KS_plus,
+    KC(52),  KS_colon,          KS_asterisk,
+    KC(50),  KS_bracketright,   KS_braceright,
+    KC(135), KS_backslash,      KS_underscore,
+    KC(137), KS_backslash,      KS_bar,
+};
+
 static const keysym_t ukbd_keydesc_swapctrlcaps[] = {
 /*  pos      command		normal		shifted */
     KC(57), 			KS_Control_L,
@@ -164,7 +183,8 @@
 			{ name, base, sizeof(map)/sizeof(keysym_t), map }
 
 const struct wscons_keydesc ukbd_keydesctab[] = {
-	KBD_MAP(KB_US,			0,	ukbd_keydesc_us),
+	KBD_MAP(KB_US,			 0,	ukbd_keydesc_us),
+	KBD_MAP(KB_JP,		         KB_US,	ukbd_keydesc_jp),
 	KBD_MAP(KB_US | KB_SWAPCTRLCAPS, KB_US,	ukbd_keydesc_swapctrlcaps),
 	{0, 0, 0, 0}
 };

>Release-Note:
>Audit-Trail:
>Unformatted: