public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joseph Carter <knghtbrd@d2dc.net>
To: Guest section DW <dwguest@win.tue.nl>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: Mac USB keyboards (Was: USB Keyboard errors with 2.4.5-ac)
Date: Sat, 30 Jun 2001 18:08:59 -0700	[thread overview]
Message-ID: <20010630180859.A5557@debian.org> (raw)
In-Reply-To: <20010701020758.B26841@win.tue.nl>

[-- Attachment #1: Type: text/plain, Size: 3221 bytes --]

On Sun, Jul 01, 2001 at 02:07:58AM +0200, Guest section DW 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.

I was pretty sure this didn't work the last time I tried it, but I went
ahead and fed your example to setkeycodes in case I missed something.  The
power key still does nothing..


> 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.

I suspect the problem is that the HID driver never sees these keys in the
first place.  Just a wild guess.


> 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.

I find that KP = can also be 134, according to this.  I suppose I could
toss some debuggatory messages into the HID driver on receipt of a USB
code that is unknown to tell me which one it is so it will be known in
that case.  =)  It's a longshot, but it sounds like a reasonable thing to
try.

> (ii) In usbkbd.c:usb_kbd_keycode[] these keycodes are converted
> to 116 and 117, and then input_event is called.

As noted, I'm using the HID driver, but the definitions match.  Neither
driver defines key 134.


> (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.

Right, that makes perfect sense.  Unfortunately, as I said, it isn't
working.  The keys do the right thing on a mac.  I can only assume that
the keyboard is being convinced somehow that these keys should be "dead"
(or the motherboard is deciding that for me..)  The other thought I have
is that perhaps the = key (the important one) is in fact key 134 on this
thing and that the power key is something else entirely.

This is, of course, just wild speculation at the moment.  I actually have
no idea if I am on the right path or going the wrong way down a one way
street.  I can assume then that if you see me running back this way fast
as I can go, the one way street has it..  ;)

Thanks for the reference.  Very nifty.

-- 
Joseph Carter <knghtbrd@d2dc.net>                   Free software developer

<dhd> is there a special christmas pack for quake
<dhd> where you get to be like the santa robot on futurama?
<dunham> dhd: that would be a rather unbalanced game...
<Knghtbrd> dunham: that's the idea.  ;>


[-- Attachment #2: Type: application/pgp-signature, Size: 273 bytes --]

  reply	other threads:[~2001-07-01  1:30 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
2001-07-01  1:08       ` Joseph Carter [this message]
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=20010630180859.A5557@debian.org \
    --to=knghtbrd@d2dc.net \
    --cc=dwguest@win.tue.nl \
    --cc=linux-kernel@vger.kernel.org \
    /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