On Jan 24, 2012, at 1:30 AM, Akhil Jindal wrote: > I am developing a desktop application on cocoa and am trying to handle the > menu keyboard shortcuts on my own.
That's weird. Why? Maybe your reasons for doing so are based on faulty assumptions or what you're _really_ trying to accomplish -- since I very much doubt that handling menu keyboard shortcuts is a first-order interest of yours -- can be done a different way that doesn't require this. > OSStatus status = UCKeyTranslate(keyboardLayout, inScanCode, > kUCKeyActionDown, inModifiers, LMGetKbdType(), > kUCKeyTranslateNoDeadKeysBit, &deadKeyState, maxStrLen, &actualLength, > strBuff); > This works fine for English language but when I use an IME, say for example > Cangjie, Zhuyin,etc things start to mess up. I have for eg a keyboard > shortcut of Cmd+N for opening a new file. But on pressing 'N' on these > IME's I get a japanese/chinese character which obviously doesn't match up > with 'N' and hence the shortcut doesn't work. What are you passing in for the modifiers? I would expect that passing in cmdKeyBit would result in UCKeyTranslate returning latin characters. Regards, Ken _______________________________________________ Cocoa-dev mailing list ([email protected]) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
