Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ukbd: new useful mappings from usb to at keycodes #9

Closed
elad opened this issue Jun 17, 2014 · 1 comment
Closed

ukbd: new useful mappings from usb to at keycodes #9

elad opened this issue Jun 17, 2014 · 1 comment

Comments

@elad
Copy link
Owner

elad commented Jun 17, 2014

Metadata

  • Number: 37683
  • Arrived: Thu Jan 03 19:15:01 +0000 2008
  • Last modified: Tue Jan 20 08:43:46 +0000 2009
  • Environment: System: NetBSD ficus 4.99.40 NetBSD 4.99.40 (FICUS) recent source change reduced FRU information for Rawhide #90: Thu Jan 3 19:57:17 CET 2008 troot@ficus:/usr/obj/sys/arch/i386/compile/FICUS i386 Architecture: i386 Machine: i386

Description


The attached patch add mappings from usb to AT keycodes for the L-keys and some
other keys found on e.g. the sun type 6 usb keyboards.
Extended AT-keycodes where found in atKeynames.h.

This patch is required when using xorg in 'standard' keyboard protocol.

Fix


--- sys/dev/usb/ukbd.c~ 2008-01-03 10:19:57.000000000 +0100
+++ sys/dev/usb/ukbd.c  2008-01-03 19:55:33.000000000 +0100
@@ -119,11 +119,11 @@
     0x7f, 0xd2, 0xc7, 0xc9, 0xd3, 0xcf, 0xd1, 0xcd, /* 48 - 4f */
     0xcb, 0xd0, 0xc8, 0x45, 0xb5, 0x37, 0x4a, 0x4e, /* 50 - 57 */
     0x9c, 0x4f, 0x50, 0x51, 0x4b, 0x4c, 0x4d, 0x47, /* 58 - 5f */
-    0x48, 0x49, 0x52, 0x53, 0x56, 0xdd,   NN, 0x59, /* 60 - 67 */
+    0x48, 0x49, 0x52, 0x53, 0x56, 0xdd, 0x84, 0x59, /* 60 - 67 */
     0x5d, 0x5e, 0x5f,   NN,   NN,   NN,   NN,   NN, /* 68 - 6f */
-      NN,   NN,   NN,   NN,   NN,   NN,   NN,   NN, /* 70 - 77 */
-      NN,   NN,   NN,   NN,   NN,   NN,   NN,   NN, /* 78 - 7f */
-      NN,   NN,   NN,   NN,   NN, 0x7e,   NN, 0x73, /* 80 - 87 */
+      NN,   NN,   NN,   NN, 0x8f, 0x88, 0x8b, 0x8d, /* 70 - 77 */
+    0x89, 0x8a, 0x8c, 0x92, 0x8e, 0x90, 0x91, 0x85, /* 78 - 7f */
+    0x87, 0x86,   NN,   NN,   NN, 0x7e,   NN, 0x73, /* 80 - 87 */
     0x70, 0x7d, 0x79, 0x7b, 0x5c,   NN,   NN,   NN, /* 88 - 8f */
       NN,   NN, 0x78, 0x77, 0x76,   NN,   NN,   NN, /* 90 - 97 */
       NN,   NN,   NN,   NN,   NN,   NN,   NN,   NN, /* 98 - 9f */


Audit trail



Responsible-Changed-From-To: kern-bug-people->tron
Responsible-Changed-By: tron@narn.netbsd.org
Responsible-Changed-When: Wed, 30 Jan 2008 21:22:17 +0000
Responsible-Changed-Why:
I'll handle this PR.


State-Changed-From-To: open->feedback
State-Changed-By: tron@narn.netbsd.org
State-Changed-When: Sat, 02 Feb 2008 15:10:09 +0000
State-Changed-Why:
The extra keys are neither mentioned in the USB-HID spec nor in Microsoft's
specification. Do you know of any technical document which lists the codes?


From: Anthony Mallet <anthony.mallet@useless-ficus.net>
To: gnats-bugs@NetBSD.org
Cc: tron@NetBSD.org,
    netbsd-bugs@netbsd.org,
    gnats-admin@netbsd.org
Subject: Re: kern/37683 (ukbd: new useful mappings from usb to at keycodes)
Date: Mon, 4 Feb 2008 09:34:15 +0100

 tron@NetBSD.org writes:
 | Synopsis: ukbd: new useful mappings from usb to at keycodes
 | 
 | State-Changed-From-To: open->feedback
 | State-Changed-By: tron@narn.netbsd.org
 | State-Changed-When: Sat, 02 Feb 2008 15:10:09 +0000
 | State-Changed-Why:
 | The extra keys are neither mentioned in the USB-HID spec nor in Microsoft's
 | specification. Do you know of any technical document which lists the codes?

 Hi,

 Yes, that's a kind of hack from Xorg (and XFree). Those "extended keys"
 are defined in atKeynames.h (e.g. /usr/pkg/include/xorg/atKeynames.h)
 because PS/2 keyboards cannot generate such events.

 Xorg says:
  * Fake 'scancodes' in the following ranges are generated for 2-byte
  * codes not handled elsewhere.  These correspond to most extended keys
  * on so-called "Internet" keyboards:
  *      0x79-0x93

 This file is not used when using the 'standard' xorg keyboard protocol
 and the translation is done by ukbd (hence this PR). OpenBSD has a
 similar patch for their driver (their cvsweb seem to be down right now, I
 cannot find the rev number but it's in ukbd.c too, from
 M. Herrb). FreeBSD did also something similar in rev. 1.46 of ukbd.c,
 although I don't know where their mappings come from.

 Note that the atKeyname file is used inside the bsd kbd driver module
 (see PR/37674).

State-Changed-From-To: feedback->open
State-Changed-By: tron@narn.netbsd.org
State-Changed-When: Mon, 04 Feb 2008 08:42:07 +0000
State-Changed-Why:
Feedback was provided.


From: Anthony Mallet <anthony.mallet@useless-ficus.net>
To: gnats-bugs@NetBSD.org
Cc: tron@NetBSD.org,
    gnats-admin@netbsd.org,
    netbsd-bugs@netbsd.org
Subject: Re: kern/37683 (ukbd: new useful mappings from usb to at keycodes)
Date: Mon, 4 Feb 2008 09:51:25 +0100

 Anthony Mallet writes:
 |  | The extra keys are neither mentioned in the USB-HID spec nor in Microsoft's
 |  | specification. Do you know of any technical document which lists the codes?

 Sorry, forgot to mention this:

 The USB keycode is defined in e.g. the microsoft document mentioned in
 ukbd.c (page 2). That's the mapping to an AT keycode that is not standard
 and defined by Xorg.

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/37683 (ukbd: new useful mappings from usb to at keycodes)
Date: Mon, 4 Feb 2008 11:00:35 +0100

 FWIW, I think we should realy follow Michael Lorenz' suggestion and modify
 all wskbd drivers to only pass raw USB keycodes up. And get rid of the
 ***** back and forth mappings in X.

 Martin

From: Matthias Drochner <M.Drochner@fz-juelich.de>
To: Anthony Mallet <anthony.mallet@useless-ficus.net>
Cc: gnats-bugs@NetBSD.org, tron@NetBSD.org, netbsd-bugs@NetBSD.org,
    gnats-admin@NetBSD.org
Subject: Re: kern/37683 (ukbd: new useful mappings from usb to at keycodes) 
Date: Tue, 05 Feb 2008 18:47:14 +0100

 anthony.mallet@useless-ficus.net said:
 > that's a kind of hack from Xorg (and XFree). Those "extended keys" are
 > defined in atKeynames.h (e.g. /usr/pkg/include/xorg/atKeynames.h)
 > because PS/2 keyboards cannot generate such events. 

 I see -- imo it makes sense to follow the examples.

 > OpenBSD has a similar patch for their driver (their cvsweb seem to be
 > down right now, I cannot find the rev number but it's in ukbd.c too,
 > from M. Herrb)

 So why does your patch differ from the OpenBSD scancodes?

 > FreeBSD did also something similar in rev. 1.46 of ukbd.c,
 > although I don't know where their mappings come from.

 FreeBSD uses another mapping mechanism appearently which I didn't
 look closer at (not just using the MSB as a marker for extended
 scancodes).

 best regards
 Matthias




 -------------------------------------------------------------------
 -------------------------------------------------------------------
 Forschungszentrum Juelich GmbH
 52425 Juelich

 Sitz der Gesellschaft: Juelich
 Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
 Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
 Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
 Dr. Ulrich Krafft (stellv. Vorsitzender), Dr. Sebastian M. Schmidt
 -------------------------------------------------------------------
 -------------------------------------------------------------------

From: Matthias Drochner <M.Drochner@fz-juelich.de>
To: gnats-bugs@NetBSD.org
Cc: tron@NetBSD.org, gnats-admin@NetBSD.org, netbsd-bugs@NetBSD.org,
    anthony.mallet@useless-ficus.net
Subject: Re: kern/37683 (ukbd: new useful mappings from usb to at keycodes) 
Date: Tue, 05 Feb 2008 18:53:45 +0100

 martin@duskware.de said:
 > we should realy follow Michael Lorenz' suggestion and modify
 >  all wskbd drivers to only pass raw USB keycodes up

 So this would mean to translate at to USB codes in pckbd.c?

 best regards
 Matthias




 -------------------------------------------------------------------
 -------------------------------------------------------------------
 Forschungszentrum Juelich GmbH
 52425 Juelich

 Sitz der Gesellschaft: Juelich
 Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
 Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
 Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
 Dr. Ulrich Krafft (stellv. Vorsitzender), Dr. Sebastian M. Schmidt
 -------------------------------------------------------------------
 -------------------------------------------------------------------

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/37683 (ukbd: new useful mappings from usb to at keycodes)
Date: Tue, 5 Feb 2008 21:03:58 +0100

 On Tue, Feb 05, 2008 at 06:55:01PM +0000, Matthias Drochner wrote:
 >  So this would mean to translate at to USB codes in pckbd.c?

 Yes - so wsmux always receives USB codes, no matter what driver is underneath.
 Think of a mac with adb + usb keyboard, or a sparc wit sun + usb. Both of
 those setups have no chance of working with X right now. (only w/o wsmux)

 Martin

From: Anthony Mallet <anthony.mallet@useless-ficus.net>
To: gnats-bugs@NetBSD.org
Cc: tron@NetBSD.org,
    gnats-admin@netbsd.org,
    netbsd-bugs@netbsd.org
Subject: Re: kern/37683 (ukbd: new useful mappings from usb to at keycodes) 
Date: Wed, 6 Feb 2008 20:24:47 +0100

 Matthias Drochner writes:
 |  > OpenBSD has a similar patch for their driver (their cvsweb seem to be
 |  > down right now, I cannot find the rev number but it's in ukbd.c too,
 |  > from M. Herrb)
 |  
 |  So why does your patch differ from the OpenBSD scancodes?

 I have not a real answer yet. First I mapped more keys than in OpenBSD:
 the L keys plus the Help, Power, AudioMute et al. keys.

 Second, I'll check with Matthieu Herrb and try to understand where the
 OpenBSD scancode come from. What he told me at the moment is that there
 is a magic offset of 8 that is added sowhere between ukbd and xkb...

 I'll keep you informed as soon as I have a more precise answer.

State-Changed-From-To: open->feedback
State-Changed-By: tron@NetBSD.org
State-Changed-When: Tue, 20 May 2008 07:51:40 +0000
State-Changed-Why:
Any update on this? Did you get an answer from Matthieu Herrb?


From: Anthony Mallet <anthony.mallet@useless-ficus.net>
To: gnats-bugs@NetBSD.org
Cc: tron@NetBSD.org,
    netbsd-bugs@netbsd.org,
    gnats-admin@netbsd.org
Subject: Re: kern/37683 (ukbd: new useful mappings from usb to at keycodes)
Date: Thu, 22 May 2008 21:04:46 +0200

 tron@NetBSD.org writes:
 | State-Changed-From-To: open->feedback
 | State-Changed-By: tron@NetBSD.org
 | State-Changed-When: Tue, 20 May 2008 07:51:40 +0000
 | State-Changed-Why:
 | Any update on this? Did you get an answer from Matthieu Herrb?

 Not really. At the time when I asked, he couldn't tell me more than
 "there is a magic offset of 8 somewhere". What is strange is that I
 couldn't find this offset elsewhere in the scancodes. But I must admit
 that I have had hard times following the trajectory of these codes all
 the way long from my keyboard to my X windows ...

 Anyway, I have absolutely no objection if you think that it's better to
 use codes from OpenBSD's patch. What I would like mostly is that my keys
 would generate some keycode, no matter the value :)

State-Changed-From-To: feedback->open
State-Changed-By: tron@NetBSD.org
State-Changed-When: Thu, 22 May 2008 20:16:27 +0000
State-Changed-Why:
Feedback was provided.


Responsible-Changed-From-To: tron->kern-bug-people
Responsible-Changed-By: tron@NetBSD.org
Responsible-Changed-When: Tue, 20 Jan 2009 08:43:46 +0000
Responsible-Changed-Why:
It is unlikely that I'm going to fix this PR.



@elad
Copy link
Owner Author

elad commented Dec 13, 2015

clutter

@elad elad closed this as completed Dec 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant