Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

HID keyboard support appears broken for some keys



Hi,

This was orinigally posted a spart of a thread on the Games list, but as it got no reply there and it is actually more a USB/HID issue I am reposting it on this list.

I ran into some issues with the HID support for keyboards. In particular I am noticing weird behavior for the arrow down key (on 10.2.6). Note that I am using the HID utilities sample, so I am wondering whether the issue is with that code or with the HID emulation for keyboards.

Examining output of my log reveals (for Apple's Extended USB keyboard):

up arrow:

Enter IOHIDCallback
down: 1
cookie: 0x0000005d
down: 0
cookie: 0x0000000a
Exit IOHIDCallback

Enter IOHIDCallback
down: 0
cookie: 0x0000005d
down: 0
cookie: 0x0000000a
Exit IOHIDCallback

But, for the down arrow I get this:

Enter IOHIDCallback
down: 1
cookie: 0x00000006
Exit IOHIDCallback

Enter IOHIDCallback
down: 0
cookie: 0x00000006
Exit IOHIDCallback

In other words, for the down arrow key the actual cookie 91 is not reported. If you use HID Device Explorer and select the down arrow element you will also see that it does not respond when the down arrow key is pressed, whereas it responds correctly when the up arrow element is selected and the up arrow is pressed.

On Panther 7B85 this problems seems to have been resolved for the down arrow key. Can anyone confirm that all keys should work correctly now? Can anyone explain what the cause of the problem was on Jaguar?

Thanks,

david.

At 8:34 +0200 23/10/03, Jens Bauer wrote:
Hi George,

-Since you wrote the great HID sample-code, I think you may be able to answer this question.

When I run HID Config Save, and press the arrow keys (one at a time), I get the following output, after choosing "Go" from the menu:


(pressing up) MyIOHIDCallbackFunction - Got Event: {t: 0x02, c: 93, v: 0x00000001}. MyIOHIDCallbackFunction - Got Event: {t: 0x02, c: 10, v: 0x52000000}. (releasing up) MyIOHIDCallbackFunction - Got Event: {t: 0x02, c: 93, v: 0x00000000}. MyIOHIDCallbackFunction - Got Event: {t: 0x02, c: 10, v: 0x00000000}. (pressing left) MyIOHIDCallbackFunction - Got Event: {t: 0x02, c: 91, v: 0x00000001}. MyIOHIDCallbackFunction - Got Event: {t: 0x02, c: 10, v: 0x50000000}. (releasing left) MyIOHIDCallbackFunction - Got Event: {t: 0x02, c: 91, v: 0x00000000}. MyIOHIDCallbackFunction - Got Event: {t: 0x02, c: 10, v: 0x00000000}. (pressing down) MyIOHIDCallbackFunction - Got Event: {t: 0x02, c: 6, v: 0x00000001}. (releasing down) MyIOHIDCallbackFunction - Got Event: {t: 0x02, c: 6, v: 0x00000000}. (pressing right) MyIOHIDCallbackFunction - Got Event: {t: 0x02, c: 90, v: 0x00000001}. MyIOHIDCallbackFunction - Got Event: {t: 0x02, c: 10, v: 0x4F000000}. (releasing right) MyIOHIDCallbackFunction - Got Event: {t: 0x02, c: 90, v: 0x00000000}. MyIOHIDCallbackFunction - Got Event: {t: 0x02, c: 10, v: 0x00000000}. HID Config Save has exited with status 0.


Now.. I'm confused. Why doesn't the callback get called twice when I press the down arrow ?
-Is this behaviour correct ?


My first thought was that it acts like the shift, control, option and command keys, but when I hold down up+left or up+right, pressing down is not recognized. This must be because of the keyboard matrix, right?

When I hold down down+left or down+right, up is (of course) not recognized either, so I still wonder why pressing down does not call the callback twice. =)


When I look at the output, it looks to me like cookie 10 is an 'array' of the keys that are currently held down (max. 4), and the other cookies are scan-codes, where the value is 0 for released, and 1 for held down. -Except for the 'e' key, which also only is called once per key event; it gives this output:


(pressing 'e')
 MyIOHIDCallbackFunction - Got Event: {t: 0x02, c: 10, v: 0x08000000}.
(releasing 'e')
 MyIOHIDCallbackFunction - Got Event: {t: 0x02, c: 10, v: 0x00000000}.

..This, of course, also confuses me a bit. What's the difference between the 'e' key and the 'r' key ?

Anyway, my conclusion is that I really need to both read cookie 10 and each key-cookie, to be sure; is this correct ?


Love, Jens
_______________________________________________
usb mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/usb
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.