• 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: Tue, 31 Mar 2009 15:49:21 -0700


On Mar 31, 2009, at 2:39 AM, Rimas M. wrote:

The code above returns unichar - symbol (!) code 0-65535. While
keyboard layout is US for example, pressing "P" (lowercase, without
shift or any other modifiers) gives code 112 (ASCII lowercase 'p',
ASCII and Unicode 0-255 matches). Meanwhile after switching keyboard
layout to RU (Cyrillic), pressing the same key produces symbol "ะท" (I
am sure on www this symbol will not be displayed) with unichar code
1079. And that is the problem - what I need to do to ensure that
pressing "p" in US and "RU" keyboard layouts will do the same action
in my app.

In that case, you'd want to use the virtual keycode - available as [event keyCode] - rather than the character code. I thought when you'd posted your original question, though, you said that you wanted your keyboard event matching to be dependent on the keyboard layout, so that if you used, for example, a Dvorak keyboard layout, where the 'p' key is generated from the physical key that has an 'r' on it in the US layout, you'd still detect and match against that physical key. That's why I suggested using the character code rather than the keycode.


-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


References: 
 >Shortcut handling in different keyboard layouts (From: "Rimas M." <email@hidden>)
 >Re: Shortcut handling in different keyboard layouts (From: Eric Schlegel <email@hidden>)
 >Re: Shortcut handling in different keyboard layouts (From: "Rimas M." <email@hidden>)
 >Re: Shortcut handling in different keyboard layouts (From: "Rimas M." <email@hidden>)

  • Prev by Date: Re: How to detect curly quotes
  • Next by Date: [NSView noob] How to be detect when a scroll view scrolls its document view
  • Previous by thread: Re: Shortcut handling in different keyboard layouts
  • Next by thread: Converting a LDragTask to Cocoa's dragImage
  • Index(es):
    • Date
    • Thread