• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: KeyCode to Character mapping
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: KeyCode to Character mapping


  • Subject: Re: KeyCode to Character mapping
  • From: Ken Thomases <email@hidden>
  • Date: Wed, 25 Jan 2012 01:54:20 -0600

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@hidden)

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:

This email sent to email@hidden


  • Follow-Ups:
    • Re: KeyCode to Character mapping
      • From: Akhil Jindal <email@hidden>
References: 
 >KeyCode to Character mapping (From: Akhil Jindal <email@hidden>)

  • Prev by Date: KeyCode to Character mapping
  • Next by Date: Re: I think I'm ready to throw in the towel - I really need help here
  • Previous by thread: KeyCode to Character mapping
  • Next by thread: Re: KeyCode to Character mapping
  • Index(es):
    • Date
    • Thread