Re: Shortcut handling in different keyboard layouts

2009-04-01 Thread Rimas M.
> Matching on keycode will almost always confuse your users. > > There are at least 9 different Cyrillic keyboard layouts supported by OS X. > If you write code that matches the virtual keycode for 2nd rank 11th key, it > will match "з" (ze) for half or those layouts and "п" (pe) for the other > ha

Re: Shortcut handling in different keyboard layouts

2009-04-01 Thread Peter Castine
Matching on keycode will almost always confuse your users. There are at least 9 different Cyrillic keyboard layouts supported by OS X. If you write code that matches the virtual keycode for 2nd rank 11th key, it will match "з" (ze) for half or those layouts and "п" (pe) for the other half.

Re: Shortcut handling in different keyboard layouts

2009-04-01 Thread Rimas M.
> 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,

Re: Shortcut handling in different keyboard layouts

2009-03-31 Thread Eric Schlegel
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 s

Re: Shortcut handling in different keyboard layouts

2009-03-31 Thread Rimas M.
On Tue, Mar 31, 2009 at 3:21 AM, Eric Schlegel wrote: > > You probably want this: [[theEvent characters] characterAtIndex:0]. > > -eric 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)

Re: Shortcut handling in different keyboard layouts

2009-03-27 Thread Rimas M.
> 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. Just to be sure - what character codes you are

Re: Shortcut handling in different keyboard layouts

2009-03-27 Thread Rimas M.
> 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. Sounds interesting. I am gonna try this right n

Re: Shortcut handling in different keyboard layouts

2009-03-26 Thread Eric Schlegel
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,

Re: Shortcut handling in different keyboard layouts

2009-03-26 Thread I. Savant
On Thu, Mar 26, 2009 at 1:16 PM, Rimas M. wrote: > 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)? I believe the ShortcutRecorder project o