Skip to content

Commit 4ff9ad6

Browse files
committed
StyledText treats shortcuts incorrectly with Japanese keyboard layout #3306
On MacOS 14 with "Japanese Kana" keyboard pressing Cmd+A results in event.keycode == 12385 while event.character == 'a'.
1 parent 9ab3898 commit 4ff9ad6

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom

bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5728,12 +5728,13 @@ void handleHorizontalScroll(Event event) {
57285728
* @param event keyboard event
57295729
*/
57305730
void handleKey(Event event) {
5731-
int action;
57325731
caretAlignment = PREVIOUS_OFFSET_TRAILING;
5732+
int action = SWT.NULL;
57335733
if (event.keyCode != 0) {
57345734
// special key pressed (e.g., F1)
57355735
action = getKeyBinding(event.keyCode | event.stateMask);
5736-
} else {
5736+
}
5737+
if (action == SWT.NULL && event.character != 0) {
57375738
// character key pressed
57385739
action = getKeyBinding(event.character | event.stateMask);
57395740
if (action == SWT.NULL) {

0 commit comments

Comments
 (0)