Mailing Lists: Apple Mailing Lists

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

Re: Eject Key Code



On Jun 26, 2006, at 9:03 AM, Daniel Tse wrote:

Hi All,

I was wondering if someone can tell what the keycode for the Eject Key is. Similarly, is there any documentation on the keycodes of all the other non-ASCII keys like Caps Lock, the volume up/down keys on the standard mac keyboard? I have tried searching Apple/ Developer but didn't find any tables or docs. I even tried using a key event grabber but the eject key takes precedence and it's not registered.

The only way to intercept them (i.e. prevent the OS from processing them) would be to write a kext.


You can receive them by writing some code to hook into the HID manager (they are filtered before they get to the normal application event queue). Any application can do this. You have to install event queues for each button you are interested in. The USB list would be a good place to ask questions about that. The USB section on the Apple dev site probably has sample code for this. You can probably find the HID keycodes for all possible keyboard buttons in the USB HID Class documentation at <http://www.usb.org>

As someone else mentioned, you can simulate key-presses with HIDPostSysDefinedKey, and a couple of other APIs.

Dave

---
The path of least resistance, it's not just for electricity any more.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Eject Key Code (From: Daniel Tse <email@hidden>)



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.