Hi Semyon,

> I ran your test on Windows and Linux. In both cases with Belgian(Dutch)
> keyboard layout I got single key combinations only, just keys were swapped
> Q->A, W->Z,  Z->W. (I don't have the Belgium physical keyboard, I only
> switched the OS layout.) It looks like that this is really Mac specific
> problem.
Hm, I tested on Linux, so it's certainly not mac-specific :-)

When you say "just keys were swapped", do you mean that changing the
layout didn't actually change any behaviour? e.g. ctrl+"the Q on the
keyboard, which is A in the layout" triggers the menu item, but
ctrl+"the A on the keyboard, which is Q in the layout" does *not*
trigger the menu item? Or do you mean that everything works as expected
with the shortcuts adapting to the new layout properly?


I posted my report two weeks ago but it was lost in the moderator queue,
so I subscribed and reposted it this afternoon. Since the first posting,
I have discovered that using keycodes for shortcuts actually suffers
from another shortcoming: Some layouts do not have just keys moved, but
the keys are different too. For example, (I think) the german layout
uses shift-7 to get / instead of / having its own key. So the ctrl-/
shortcut should really become ctrl-shift-7 on that layout, which is more
than just using the extended keycode instead of the normal keycode.

In other words, mapping keycodes for shortcuts can, AFAICS, never
reliably deal with alternative keyboard layouts. Using KEY_TYPED, which
has the actual character made, would then be better, except that
KeyStroke objects for KEY_TYPED events never include any modifiers,
making them again unsuitable.

I'm not really sure how this should be fixed (I'm not a very experienced
java coder, let along JDK hacker), but hopefully others can pick this up
from here :-)

Gr.

Matthijs

Attachment: signature.asc
Description: Digital signature

Reply via email to