Mailing Lists: Apple Mailing Lists

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

KeyTranslate and UCKeyTranslate question



Hi,

My application allows users to specify a hot key for activating it. This is done using a text field in the Preferences, and my controller catches keyDown events if that field has the focus, stores the key code and displays the character(s) represented by the key.

Of course, after the user quits and re-opens the app I also need to display the the key in the text field (and display the right character even if they change the keyboard layout in the meantime).

This is why I can't just display the NSEvent's "characters", but instead use the KeyTranslate and UCKeyTranslate functions to translate the key code to characters.

However, these functions don't seem to return the right characters for many keys (e.g. Delete, Enter, the cursor keys and F-keys).

Does anyone know if there is a way around this, apart from hard-coding those key codes that don't work?

Thanks
Amar

_______________________________________________
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


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.