NetBSD Problem Report #48347

From www@NetBSD.org  Sun Oct 27 18:05:19 2013
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id D10A9A5C6A
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 27 Oct 2013 18:05:19 +0000 (UTC)
Message-Id: <20131027180518.4BA45A5D7B@mollari.NetBSD.org>
Date: Sun, 27 Oct 2013 18:05:18 +0000 (UTC)
From: oshima-ya@yagoto-urayama.jp
Reply-To: oshima-ya@yagoto-urayama.jp
To: gnats-bugs@NetBSD.org
Subject: Cannot input Japanese special keys of JP106 keyboard with NetBSD/evbarm(RPI) or some arch.
X-Send-Pr-Version: www-1.0

>Number:         48347
>Category:       xsrc
>Synopsis:       Cannot input Japanese special keys of JP106 keyboard with NetBSD/evbarm(RPI) or some arch.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    xsrc-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Oct 27 18:10:00 +0000 2013
>Last-Modified:  Sat Apr 26 04:25:00 +0000 2014
>Originator:     Yasushi Oshima
>Release:        NetBSD 6.1_STABLE
>Organization:
>Environment:
NetBSD rpi 6.1_STABLE NetBSD 6.1_STABLE (RPI) #0: Tue Jul 30 08:48:25 JST 2013  oshima@sweety:/export/netbsd-6/obj/evbarm/sys/arch/evbarm/compile/RPI evbarm
>Description:
When using X environment with USB JP106 keyboard, 
some special keys of JP106 are not able to input.
These keys always return keycode 8, this code is unused on Xserver.
Because these keys return the same code, cannot map a unique keysym with xmodmap.

This occurs on NetBSD/dreamcast, this JP-kbd has the same keycode with USB kbd.
>How-To-Repeat:
Connect JP106 Key to RPI and startx,
Change keyboard map to jp:
 setxkbmap -layout jp -keymap jp106
Input JP106 special key:
 '\|' (Left of Back Space on JP106)
 '\_' (Left of Right-Shift on JP106)
 Muhenkan (Left of SPACE BAR on JP106)
 Henkan (Right of SPACE BAR on JP106)
 KATAKANA-HIRAGANA (Right of Henkan on JP106, or Left of MENU/WIN)

Watch keycode with xev(1).


>Fix:
Patch for bsd_KbdMap.c for NetBSD/current.
See also usbmap[] of external/mit/xf86-input-keyboard/dist/src/sun_kbdMap.c. 
This patch is made into the same as sun_kbdMap.c.

--- external/mit/xf86-input-keyboard/dist/src/bsd_KbdMap.c        16 Jul 2012 12:49:42 -0000      1.8
+++ external/mit/xf86-input-keyboard/dist/src/bsd_KbdMap.c        27 Oct 2013 17:14:23 -0000
@@ -346,17 +346,32 @@
        /* 132 */ KEY_NOTUSED,
        /* 133 */ KEY_NOTUSED,
        /* 134 */ KEY_NOTUSED,
-       /* 135 */ KEY_NOTUSED,
-       /* 136 */ KEY_NOTUSED,
-       /* 137 */ KEY_NOTUSED,
-       /* 138 */ KEY_NOTUSED,
-       /* 139 */ KEY_NOTUSED,
-       /* 140 */ KEY_NOTUSED,
-       /* 141 */ KEY_NOTUSED,
-       /* 142 */ KEY_NOTUSED,
-       /* 143 */ KEY_NOTUSED,
-       /* 144 */ KEY_NOTUSED,
-       /* 145 */ KEY_NOTUSED,
+/*
+ * Special keycode for For Japanese keyboard
+ * Override atKeyname HKTG and BSlash2 code to unique for JP106 keybaord
+ */
+#undef KEY_HKTG
+#define KEY_HKTG       200 /* Japanee Hiragana Katakana Toggle */
+#undef KEY_BSlash2
+#define KEY_BSlash2    203 /* Japanese '\_' key */
+
+        /* 135 */ KEY_BSlash2, /* Japanese 106 kbd: '\_' */
+        /* 136 */ KEY_HKTG,    /* Japanese 106 kbd: Hiragana Katakana toggle */
+        /* 139 */ KEY_XFER,    /* Japanese 106 kbd: Henkan */
+        /* 139 */ KEY_NFER,    /* Japanese 106 kbd: Muhenkan */
+        /* 140 */ KEY_NOTUSED,
+        /* 141 */ KEY_NOTUSED,
+        /* 142 */ KEY_NOTUSED,
+        /* 143 */ KEY_NOTUSED,
+/*
+ * Special keycode for For Korean keyboard
+ * Define Hangul and Hangul_Hanja unique key code
+ * These keys also use KANA and EISU on some Macintosh Japanese USB Keyboards
+ */
+#define KEY_Hangul             201     /* Also KANA Key on Mac JP USB kbd */
+#define KEY_Hangul_Hanja       202     /* Also EISU Key on Mac JP USB kbd */
+        /* 144 */ KEY_Hangul,          /* Korean 106 kbd: Hangul */
+        /* 145 */ KEY_Hangul_Hanja,    /* Korean 106 kbd: Hangul Hanja */
        /* 146 */ KEY_NOTUSED,
        /* 147 */ KEY_NOTUSED,
        /* 148 */ KEY_NOTUSED,

Ref: USB HID Usage Tables:
  http://www.usb.org/developers/devclass_docs/Hut1_11.pdf Page 60

When netbsd-6 branch, require the change rev1.7:
http://cvsweb.netbsd.org/bsdweb.cgi/xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_KbdMap.c.diff?r1=1.6&r2=1.7&f=h

>Audit-Trail:
From: Yasushi Oshima <oshima-ya@yagoto-urayama.jp>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: xsrc/48347: Cannot input Japanese special keys of JP106
 keyboard with NetBSD/evbarm(RPI) or some arch.
Date: Mon, 28 Oct 2013 23:54:16 +0900 (JST)

 Additional information:

 This problem does not occur on i386 or amd64 with USB JP-kbd.
 I encountered this problem only on RPI and dreamcast, but I don't have another
 arch machines.

 I guess that it will occur only on arches that undefined PCVT_SUPPORT flag in
 src/external/mit/xorg/server/drivers/xf86-input-keyboard/Makefile

 Thanks.

From: Yasushi Oshima <oshima-ya@yagoto-urayama.jp>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: xsrc/48347: Cannot input Japanese special keys of JP106
 keyboard with NetBSD/evbarm(RPI) or some arch.
Date: Sun, 03 Nov 2013 03:25:25 +0900 (JST)

 I have mistaken in my previous patch.

 This is a new patch.

 RCS file: /cvsroot/xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_KbdMap.c,v
 retrieving revision 1.8
 diff -u -r1.8 bsd_KbdMap.c
 --- bsd_KbdMap.c        16 Jul 2012 12:49:42 -0000      1.8
 +++ bsd_KbdMap.c        2 Nov 2013 17:42:09 -0000
 @@ -346,17 +346,33 @@
         /* 132 */ KEY_NOTUSED,
         /* 133 */ KEY_NOTUSED,
         /* 134 */ KEY_NOTUSED,
 -       /* 135 */ KEY_NOTUSED,
 -       /* 136 */ KEY_NOTUSED,
 -       /* 137 */ KEY_NOTUSED,
 -       /* 138 */ KEY_NOTUSED,
 -       /* 139 */ KEY_NOTUSED,
 -       /* 140 */ KEY_NOTUSED,
 -       /* 141 */ KEY_NOTUSED,
 -       /* 142 */ KEY_NOTUSED,
 -       /* 143 */ KEY_NOTUSED,
 -       /* 144 */ KEY_NOTUSED,
 -       /* 145 */ KEY_NOTUSED,
 +/*
 + * Special keycode for For Japanese keyboard
 + * Override atKeyname HKTG and BSlash2 code to unique for JP106 keybaord
 + */
 +#undef KEY_HKTG
 +#define KEY_HKTG	200	/* Japanee Hiragana Katakana Toggle */
 +#undef KEY_BSlash2
 +#define KEY_BSlash2	203	/* Japanese '\_' key */
 +
 +	/* 135 */ KEY_BSlash2,	/* Japanese 106 kbd: '\_' */
 +	/* 136 */ KEY_HKTG,	/* Japanese 106 kbd: Hiragana Katakana toggle */
 +	/* 137 */ KEY_Yen,	/* Japanese 106 kbd: '\|' */
 +	/* 138 */ KEY_XFER,	/* Japanese 106 kbd: Henkan */
 +	/* 139 */ KEY_NFER,	/* Japanese 106 kbd: Muhenkan */
 +	/* 140 */ KEY_NOTUSED,
 +	/* 141 */ KEY_NOTUSED,
 +	/* 142 */ KEY_NOTUSED,
 +	/* 143 */ KEY_NOTUSED,
 +/*
 + * Special keycode for For Korean keyboard
 + * Define Hangul and Hangul_Hanja unique key code
 + * These keys also use KANA and EISU on some Macintosh Japanese USB Keyboards
 + */
 +#define KEY_Hangul		201	/* Also KANA Key on Mac JP USB kbd */
 +#define KEY_Hangul_Hanja	202	/* Also EISU Key on Mac JP USB kbd */
 +	/* 144 */ KEY_Hangul,		/* Korean 106 kbd: Hangul */
 +	/* 145 */ KEY_Hangul_Hanja,	/* Korean 106 kbd: Hangul Hanja */
         /* 146 */ KEY_NOTUSED,
         /* 147 */ KEY_NOTUSED,
         /* 148 */ KEY_NOTUSED,

 I tested this on NetBSD/evbarm on RPI, NetBSD/dreamcast, and NetBSD/amd64(*1).

 *1:
 On i386 or amd64:
  This will occur only when using USB JP keyboard and specifying 
  wskbd protocol explicitly in xorg.conf as folows:

   Section "InputDevice"
         Identifier  "Keyboard0"
         Driver      "kbd"
         Option      "Protocol" "wskbd"
    EndSection


 Thanks.

From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/48347 CVS commit: xsrc/external/mit/xf86-input-keyboard/dist/src
Date: Fri, 4 Apr 2014 08:50:09 -0400

 Module Name:	xsrc
 Committed By:	christos
 Date:		Fri Apr  4 12:50:09 UTC 2014

 Modified Files:
 	xsrc/external/mit/xf86-input-keyboard/dist/src: bsd_KbdMap.c

 Log Message:
 PR/48347: Yasushi Oshima: Cannot input Japanese special keys of JP106 keyboard
 with NetBSD/evbarm(RPI) or some arch.


 To generate a diff of this commit:
 cvs rdiff -u -r1.9 -r1.10 \
     xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_KbdMap.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: PR/48347 CVS commit:
 xsrc/external/mit/xf86-input-keyboard/dist/src
Date: Sat, 26 Apr 2014 04:22:36 +0000

 On Fri, Apr 04, 2014 at 12:55:00PM +0000, Christos Zoulas wrote:
  >  PR/48347: Yasushi Oshima: Cannot input Japanese special keys of JP106 keyboard
  >  with NetBSD/evbarm(RPI) or some arch.

 Should this go into -6?

 -- 
 David A. Holland
 dholland@netbsd.org

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.