New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8262981: Create implementation for NSAccessibilitySlider protocol #2874
Conversation
👋 Welcome back pbansal! A progress list of the required criteria for merging this PR into |
@pankaj-bansal The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.m
Show resolved
Hide resolved
If you need a new functionality and CSR I wonder how it currently works on Windows and macOS, or it does not work? |
Haven't tested this functionality on Windows, on macOS with current JDK it does not work at all. After entering the JSlider interaction mode VoiceOver does not announce the a11y shortcuts and the attempt to invoke said shortcuts do nothing. |
|
Yes, as Alex pointed out, it does not work on MacOS. The VO only announces the value and user can not modify the slider values using VO shortcut keys. I saw the windows code and I did not see anything where the current value of a component is being set. I tested this by running JAWS as well. When a JSlider is in focus, JAWS announces the slider values and then says "To increase or decrease, use the arrow keys". The keys are being handled by JAVA only and JAWS is not doing any part in it. To verify this, I commented the code to handle keys events in Java and slider value does not change. So looks like this does not work on Windows as well. If these changes are too intrusive, I can go with the second approach of getting and setting the current values of slider in performincrement/performdecrement functions in SliderAccessibility.m. I am not sure if this will be correct approach, but it will be less intrusive and will not need a CSR. |
If it does not work on Windows then I suggest checking that the new functionality requested via CSR will help it as well. |
I would suggest to fix it properly by filing CSR for the functional change. The idea of new implementation is not only to make it compatible with the new Apple API, but also to make it cleaner, more consistent and easier to support in the future. |
I could not find any key shortcuts where JAWS will consume the key pressed and will be used to interact with the component like the VO is doing here. This similar functionality is present in JSpinner already and JAWS says similar thing when a Spinner is in focus "To set the value, press the arrow keys or type the value". When user presses the keys, it is consumed by Java and value is incremented/decremented as expected. But the value is not being set by JAWS like VO if used with VO keys. So I am not sure how to verify if the changes will be useful for windows as well. I think if there is a way user can interact with Spinner or Slider, then these changes should be useful and if it is not possible, it will not be useful in both. These changes does make the Slider more consistent with Spinner and easy to maintain and cleaner. |
How the native applications works under JAWS? |
I tried running a Windows native settings app like "Display Settings" with JAWS. It has a Slider "Brightness". JAWS says same thing when the Slider was brought in focus like "To increase or decrease, use the arrow keys". When I press the arrow keys, the values change. But I don't know if the value changed because the Windows Native dialog handles the keys and changed the value, or JAWS consumed the event and then changed the value. It looks like the Dialog must have handled the keys as there are no special keys mentioned for JAWS to interact with the component like the VO. I am not sure how I can verify this on Windows native apps. |
Did you check this list of hotkeys? ======================= |
I tried the hot keys with the both native dialog ("Display Settings" with a "Brightness" Slider ) and java applications. |
Ok, please file a similar bug for the windows platform. |
/csr |
@pankaj-bansal has indicated that a compatibility and specification (CSR) request is needed for this pull request. |
I have created the bug for windows here https://bugs.openjdk.java.net/browse/JDK-8264598. |
@mrserb @azuev-java Any other comments on this? Can you please look at the CSR also? |
I have no additional comments. |
@pankaj-bansal This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 154 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
/integrate |
@pankaj-bansal Since your change was applied there have been 183 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 9d669c9. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Create implementation of NSAccessibilitySlider protocol https://developer.apple.com/documentation/appkit/nsaccessibilityslider
The implementation has the function performIncrement and performDecrement to increase/decrease the value of slider using the VoiceOver. To implement this functionality, I could think of following two ways. I have chosen the first one here though it is more intrusive.
The changes can be easily tested by using a JSlider example, like the following example. VO should announce the correct the slider values. To change the slider values, use ctrl+opt+shift+down key to start interacting with the slider, then use ctrl+opt+up/down arrow keys to increment/decrement slider values.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/2874/head:pull/2874
$ git checkout pull/2874
Update a local copy of the PR:
$ git checkout pull/2874
$ git pull https://git.openjdk.java.net/jdk pull/2874/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 2874
View PR using the GUI difftool:
$ git pr show -t 2874
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/2874.diff