Skip to content

Commit 1fd1058

Browse files
committed
Backport a46ae7031e30eb4940e43012a42f1b7fa5d942ef
1 parent 7213c0d commit 1fd1058

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

src/jdk.accessibility/windows/classes/com/sun/java/accessibility/internal/AccessBridge.java

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -3851,6 +3851,8 @@ private int controlCode(KeyStroke keyStroke) {
38513851
return 0;
38523852
int code = keyStroke.getKeyCode();
38533853
switch (code) {
3854+
case KeyEvent.VK_TAB:
3855+
case KeyEvent.VK_SPACE:
38543856
case KeyEvent.VK_BACK_SPACE:
38553857
case KeyEvent.VK_DELETE:
38563858
case KeyEvent.VK_DOWN:
@@ -3893,15 +3895,10 @@ private char getKeyChar(KeyStroke keyStroke) {
38933895
debugString("[INFO]: Shortcut is control character: " + Integer.toHexString(keyCode));
38943896
return (char)keyCode;
38953897
}
3896-
String keyText = KeyEvent.getKeyText(keyStroke.getKeyCode());
3897-
debugString("[INFO]: Shortcut is: " + keyText);
3898-
if (keyText != null || keyText.length() > 0) {
3899-
CharSequence seq = keyText.subSequence(0, 1);
3900-
if (seq != null || seq.length() > 0) {
3901-
return seq.charAt(0);
3902-
}
3903-
}
3904-
return 0;
3898+
3899+
keyCode = keyStroke.getKeyCode();
3900+
debugString("[INFO]: Shortcut is: " + Integer.toHexString(keyCode));
3901+
return (char)keyCode;
39053902
}
39063903

39073904
/*

src/jdk.accessibility/windows/native/include/bridge/AccessBridgePackages.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -1108,6 +1108,8 @@ typedef long ABHWND64;
11081108
#define ACCESSIBLE_CONTROLCODE_KEYSTROKE 512 // Control code key pressed, character contains control code.
11091109

11101110
// The supported control code keys are:
1111+
#define ACCESSIBLE_VK_TAB 9
1112+
#define ACCESSIBLE_VK_SPACE 32
11111113
#define ACCESSIBLE_VK_BACK_SPACE 8
11121114
#define ACCESSIBLE_VK_DELETE 127
11131115
#define ACCESSIBLE_VK_DOWN 40

0 commit comments

Comments
 (0)