Subject: kern/32755: Some keys generate wrong keysyms on USB-keyboards in console
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <jarmo.jaakkola@iki.fi>
List: netbsd-bugs
Date: 02/06/2006 00:05:01
>Number:         32755
>Category:       kern
>Synopsis:       Some keys generate wrong keysyms on USB-keyboards in console
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 06 00:05:00 +0000 2006
>Originator:     Jarmo Jaakkola
>Release:        NetBSD 2.1
>Organization:
>Environment:
NetBSD arthur.ritari.ton.tut.fi 2.1 NetBSD 2.1 (ARTHUR) #4: Wed Dec 21 19:36:58 EET 2005 jammuli@arthur.ritari.ton.tut.fi:/usr/src/sys/arch/i386/compile/ARTHUR i386

>Description:
USB- and PS/2-keymaps seem to differ in some areas.  Couple things I have noticed:

USB-keyboards generate KS_BackSpace for the <-- key when PS/2 keyboards produce KS_Delete, which I suppose is the correct one as the console works correctly with that by default.

In the sv-encoding, the keysyms for the keycode 50 are wrong.  Instead of comma, there should be an apostrophe.  Many things are quite impossible when there's no apostrophe in the keymap.

Also, some functionality like scrolling is missing from the USB-keyboards.

There might be more but this is what caused problems for me.
>How-To-Repeat:
Plug-in a USB-keyboard and for the second one also change the wskbd encoding to sv (or fi).

>Fix:
Change the lines in src/sys/dev/usb/ukbdmap.c as follows (in us-encoding):
-    KC(42),                     KS_BackSpace,
+    KC(42),  KS_Cmd_ResetEmul,  KS_Delete,

-    KC(75),  KS_Cmd_ScrollFastUp, KS_Prior,
+    KC(75),                     KS_Prior,

-    KC(75),                     KS_Next,
+    KC(75),  KS_Cmd_ScrollFastDown, KS_Next,

And in the sv-encoding:
-    KC(50),  KS_comma,          KS_asterisk,
-    KC(100), KS_less,           KS_greater,     KS_bar,

(The sv-layout is based on the dk-layout, so those two lines are redundant and the keycode 50 line is also wrong)