public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Guest section DW <dwguest@win.tue.nl>
To: Joseph Carter <knghtbrd@d2dc.net>, Tim Jansen <tim@tjansen.de>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: Mac USB keyboards (Was: USB Keyboard errors with 2.4.5-ac)
Date: Sun, 1 Jul 2001 02:07:58 +0200	[thread overview]
Message-ID: <20010701020758.B26841@win.tue.nl> (raw)
In-Reply-To: <01063000110000.01057@cookie> <20010629214840.B14167@debian.org>
In-Reply-To: <20010629214840.B14167@debian.org>; from Joseph Carter on Fri, Jun 29, 2001 at 09:48:40PM -0700

On Fri, Jun 29, 2001 at 09:48:40PM -0700, Joseph Carter wrote:

> If you're using it on a wintel arch machine, have you managed to get the
> numeric keypad's = key or the power key to work?  Doesn't here and I've
> tried more than one model of keyboard on more than one machine, no luck
> even with showkey.  MacOS likes the keys just fine, naturally.

I just borrowed a Mac keyboard and looked.
The Numpad = key gave scancode 5c, the power key gave e05e.
The command getkeycodes showed that the former was assigned to
keycode 127, while the latter was not assigned.
The command "setkeycodes e05e 25", where 25 is the keycode
for the letter p, made the power key produce the letter p.

You see that you can do with a USB keyboard what you can do
with an ordinary keyboard: use setkeycodes to assign a keycode
to scancode combinations that didnt have one yet, use loadkeys
to assign a function to a keycode.

To understand the details of the code, trace the steps:
(i)  The USB code can be found e.g. on
	http://www.win.tue.nl/~aeb/linux/kbd/scancodes-5.html
We find that Power is 102 and that Keypad-= is 103.
(ii) In usbkbd.c:usb_kbd_keycode[] these keycodes are converted
to 116 and 117, and then input_event is called.
(iii) In keybdev.c:x86_keycodes[] these codes are converted
to 350 and 92. The former is 256+94 and becomes e05e, the latter 5c.
This is fed further to the usual keyboard processing.

Andries

  reply	other threads:[~2001-07-01  0:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-29 17:27 USB Keyboard errors with 2.4.5-ac Jordan Breeding
2001-06-29 22:11 ` Tim Jansen
2001-06-30  4:48   ` Mac USB keyboards (Was: USB Keyboard errors with 2.4.5-ac) Joseph Carter
2001-07-01  0:07     ` Guest section DW [this message]
2001-07-01  1:08       ` Joseph Carter
2001-07-01 11:26         ` Guest section DW
2001-07-01 13:07           ` Joseph Carter
2001-06-30 17:53   ` USB Keyboard errors with 2.4.5-ac Jordan
2001-06-30 17:48 ` Jakob Borg
2001-06-30 18:14   ` hiufungeric.tse
2001-07-02  6:39   ` Greg KH
2001-07-02  7:08     ` Jakob Borg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010701020758.B26841@win.tue.nl \
    --to=dwguest@win.tue.nl \
    --cc=knghtbrd@d2dc.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tim@tjansen.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox