I've not used CGEvents much.. (Once upon a time, hopefully never again) but if I remember rightly CGKeyCodes are equivalent to NSEvent keyCodes*. If not you can easily convert between the two using: + (NSEvent *)eventWithCGEvent:(CGEventRef)cgEvent.

Have a look at this: http://inquisitivecocoa.com/2009/04/05/key-code-translator/ for my version of what I think your trying to achieve. Be warned, there are a few gaps in my implementation (like F numbers for instance), but that shouldn't be that hard to add.

Harry Jordan
http://inquisitivesoftware.com/

On 19 Awst 2009, at 18:40, Joe Turner wrote:

Hey,

I've got an application that basically simulates a keyboard using CGEvents with CGKeyCodes. However, because CGKeyCodes only map the position of the key on a keyboard, and not the actual key, I've run into some issues. Is there an easy way to detect the type of keyboard they have, and convert a CGKeyCode from a standard US keyboard to whatever keyboard they have?

Any help would be much appreciated! :)

Joe
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/cocoaharry%40googlemail.com

This email sent to cocoaha...@googlemail.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to