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

Shortcut handling in different keyboard layouts


  • Subject: Shortcut handling in different keyboard layouts
  • From: "Rimas M." <email@hidden>
  • Date: Thu, 26 Mar 2009 19:16:46 +0200

Hello,

I have a question about how properly keyboard shortcuts should be
handled. For example "pressing key X performs action W". How to ensure
that this will work with all keyboard layouts (Cyrillic etc)?
Currently I am checking key down event characters, but that is a wrong
way, because when layout is changed to Cyrillic that does not work. I
thought that would be great to use keyCode to check which action
should be performed. But then I remembered German keyboard layout - it
has Z and Y mixed. Keyboard button, which has label "Z" in US layout
produces keyCode 6, and button with label "Y" produces 16. In German
layout codes are the same, but labels swapped.
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. 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?
Help would be very appreciate.

Regards,

Rimas M.
_______________________________________________

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: Eric Schlegel <email@hidden>
    • Re: Shortcut handling in different keyboard layouts
      • From: "I. Savant" <email@hidden>
  • Prev by Date: Re: [Q] Strange Drag & Drop from my app to FCP project window
  • Next by Date: Converting a LDragTask to Cocoa's dragImage
  • Previous by thread: Re: NSTableView reloadData from two sources?
  • Next by thread: Re: Shortcut handling in different keyboard layouts
  • Index(es):
    • Date
    • Thread