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