• 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: Shortcut handling in different keyboard layouts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Shortcut handling in different keyboard layouts


  • Subject: Re: Shortcut handling in different keyboard layouts
  • From: Eric Schlegel <email@hidden>
  • Date: Thu, 26 Mar 2009 20:44:56 -0700


On Mar 26, 2009, at 10:16 AM, Rimas M. wrote:

Take iTunes as example. With US layout enabled, pressing Cmd+Y calls
Preferences. Meanwhile to do the same in German layout you need to
press also Cmd+Y, but "Y" button is not the same as in US and produces
different code.

In this particular case, the command key matching functionality is provided by the OS (HIToolbox specifically), and the matching code uses character codes, not keycodes.


I am wondering - how to check incoming key down events
to achieve that functionality. I am sure, that checking characters is
wrong way. Better would be to check keyCodes, but not perfect. Is
there a third way in Cocoa?

In general, using character codes is the most appropriate way. It lets the matching code automatically adapt to whatever the current keyboard layout may be. If you check the character code, it doesn't matter which physical key you've pressed.


-eric

_______________________________________________

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: Shortcut handling in different keyboard layouts
      • From: "Rimas M." <email@hidden>
    • Re: Shortcut handling in different keyboard layouts
      • From: "Rimas M." <email@hidden>
References: 
 >Shortcut handling in different keyboard layouts (From: "Rimas M." <email@hidden>)

  • Prev by Date: Re: NSFileManager: can't set group ID on 10.4
  • Next by Date: [Solved] Need help animating a view-switch
  • Previous by thread: Re: Shortcut handling in different keyboard layouts
  • Next by thread: Re: Shortcut handling in different keyboard layouts
  • Index(es):
    • Date
    • Thread