Community
Participate
Working Groups
I use a custom unicode keyboard layout (.keylayout, cf. http://developer.apple.com/technotes/tn2002/tn2056.html). Typing normal text results in the appropriate letters being printed, but in combination with a modifier, the wrong key events are triggered! For instance Command+J on my dvorak keyboard will incorrectly copy the selection (presumably because J on a dvorak keyboard is where the C is on a regular keybard).
for fun see what looks like the opposite problem, bug 153238 That's where we only accept the mapped key, not the original hardware key. PW
I now believe this is caused by SWT. More precisely in org/eclipse/swt/widgets/Widget.java around line 1900 OS.KeyTranslate is called, which should be UCKeyTranslate for unicode keyboards. I believe the correct way to handle this would be to query KLGetKeyboardLayoutProperty with kKLKind, as that's how I fixed pretty much the same bug in GNU Emacs. (That patch can be found at http://groups.google.com/group/gnu.emacs.bug/browse_thread/thread/91a762947293db61/920d55eaeca19df7)
Created attachment 48220 [details] proposed patch I've written a patch that fixes this issue for me.
We should fix this.
I am not sure how to reproduce your problem. I am using the SWT Snippet25 and it seems that the output is appropriate when I press Cmd+J with dvorak keyboard. Please could you provide your custom keyboard layout and steps how to reproduce the problem with the custom keyboard layout or with one of the default unicode layouts? Pressed j DOWN: stateMask=0x0, keyCode=0x6a 'j', character=0x6a 'j' UP : stateMask=0x0, keyCode=0x6a 'j', character=0x6a 'j' Pressed Shift+j DOWN: stateMask=0x0, keyCode=0x20000 SHIFT, character=0x0 '\0' DOWN: stateMask=0x20000 SHIFT, keyCode=0x6a 'j', character=0x4a 'J' UP : stateMask=0x20000 SHIFT, keyCode=0x6a 'j', character=0x4a 'J' UP : stateMask=0x20000 SHIFT, keyCode=0x20000 SHIFT, character=0x0 '\0' Pressed Cmd+j DOWN: stateMask=0x0, keyCode=0x400000 COMMAND, character=0x0 '\0' DOWN: stateMask=0x400000 COMMAND, keyCode=0x6a 'j', character=0x6a 'j' UP : stateMask=0x400000 COMMAND, keyCode=0x400000 COMMAND, character=0x0 '\0' UP : stateMask=0x0, keyCode=0x6a 'j', character=0x6a 'j'
Created attachment 49045 [details] my keyboard layout Drop this file into ~/Library/Keyboard Layouts/ (create if needed), log off and on, and select this keyboard the same way as any other. What I get with Snippet25 is this: DOWN: stateMask=0x0, keyCode=0x63 'c', character=0x6a 'j' UP : stateMask=0x0, keyCode=0x63 'c', character=0x6a 'j' Most system keyboards provide both a unicode and classic keyboard resource, which is why this problem doesn't appear with the regular dvorak keyboard.
Created attachment 59751 [details] patch for 3325 a new patch that applies cleanly to the current development (3325) version
*** Bug 238647 has been marked as a duplicate of this bug. ***
I've ran into this bug too. I'm using a custom keyboard layout defined through Ukelele (http://scripts.sil.org/ukelele) to work around the horrible default keyboard layout defined by Apple for AZERTY-type keyboards. The default layout differs substantially from the PC and old typewriter versions and is basically unusable for touch typists or for use in the JDT because most of the interesting "{}[]\|" characters are behind complex, RSI-inducing shortcuts. Like stated in comment #6, this custom keyboard layout only provides a unicode version. However, this layout works fine in Carbon, Cocoa and AWT/Swing applications. In SWT-apps, the "plain" keys work, but typing CMD-Z actually sends CMD-W to the app, resulting in closing the window instead of undoing a change in the JDT for instance. Is there something wrong with the proposed patch that it hasn't gone in yet ? Admittedly, there are probably few people affected by this; but for those that are it makes SWT apps with keyboard shortcuts very user-unfriendly.
Silenio, do you have any more on this?
Fixed > 20090120. Please try the latest and reopen if you still see issues.