RFR: 8339728 : [Accessibility, Windows, JAWS] Bug in the getKeyChar method of the AccessBridge class [v5]
Prasanta Sadhukhan
psadhukhan at openjdk.org
Mon Jan 6 06:19:50 UTC 2025
On Mon, 6 Jan 2025 06:10:27 GMT, Abhishek Kumar <abhiscxk at openjdk.org> wrote:
>> For a JMenuItem with a shortcut like _Ctrl + Comma_, the `getKeyChar` method of the `AccessBridge` class cuts the _Comma_ text to the first character and hence transfers `C (instead of Comma)` via the `AccessBridge` API. For a shortcut _Ctrl + Comma_ in a menu item, screen readers announce _Ctrl + C_ instead of _Ctrl + Comma_ as shortcut. Same issue exists for **Enter, Period and other keys** as well where only the first character is returned from the getKeyChar method.
>>
>> Proposed fix is to ensure that the _char representation of the shortcuts_ is returned by the `getKeyChar` method and it worked fine except for **"Enter"** key. It is unclear to me why it has not announced by AT (JAWS) but I think that may be due to the char representation of the Enter key which is a Line Feed.
>>
>> AT was also not able to announce the _Tab and Space_ key as a shortcut. Adding these keys in the control key list in _AccessBridge_ and in supported control code list in _AccessBridgePackages_ files enabled them to be announced by AT.
>>
>> Manual test case is added to verify the shortcut for JMenuItems.
>
> Abhishek Kumar has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
>
> - Merge branch 'master' into JDK-8339728
> - Copyright year and minor fix
> - Review comment update
> - Copyright year and test update
> - MenuItem shortcut accessibility fix
src/jdk.accessibility/windows/native/include/bridge/AccessBridgePackages.h line 2:
> 1: /*
> 2: * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
this copyright also needs to be updated..
test/jdk/javax/accessibility/TestJMenuItemShortcutAccessibility.java line 45:
> 43: public static void main(String[] args) throws Exception {
> 44: String INSTRUCTIONS = """
> 45: 1. Start the JAWS aplication
"application"
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22822#discussion_r1903709299
PR Review Comment: https://git.openjdk.org/jdk/pull/22822#discussion_r1903712911
More information about the client-libs-dev
mailing list