Announce function key shortcut keys in java swing applications#13676
Conversation
… java swing applications.
See test results for failed build of commit 308a963e60 |
|
I am aware of the lint failure, but I could not find a code style which would satisfy it. The issue seems to be about indentation and when I fix the one it leads to another which implies doing it the way I originally did it. So I have done it the closest to the guidelines in the contributor documentation. |
|
Hi, this is one of the reasons why I tend to perform a general lint on surrounding code (mostly at the function/method level). I also use a customized Flake8 config file used for my own add-ons wen linting NVDA Core code from scratch (the obvious advantage is that I can look at what Flake8 says about the entire file and lint the modified parts). Thanks.
|
|
I have taken a look about things like keys such as escape, enter, space, tab, etc. NVDA just reads the first letter of the words (eg. S for space, T for tab, etc). The biggest problem is that enter and escape are both E. I also tested that with Jaws and Jaws does similar for these shortcut keys, so I think it is a Java Access Bridge limitation/bug, so this PR is probably the best we can do at the moment. |
|
This also fixes issue #10994 |
seanbudd
left a comment
There was a problem hiding this comment.
I've pushed a commit to fix the lint.
I've also pushed a commit to change the constants to enums.
This is preferred for new groups of constants, however we need to keep the previous naming scheme backwards compatible for add-ons.
I've asked for some help finishing up the documentation but this PR LGTM otherwise.
|
|
||
| class Accessible(IntFlag): | ||
| """ | ||
| TODO: The documentation for this mapping is here: |
There was a problem hiding this comment.
@mwhapples would you be able to add to this docstring
| class AccessibleVK(IntEnum): | ||
| """ | ||
| The supported control code keys related to Accessible.CONTROLCODE_KEYSTROKE. | ||
| TODO: The documentation for this mapping is here: |
There was a problem hiding this comment.
@mwhapples would you be able to add to this docstring
There was a problem hiding this comment.
Just pushed a commit giving the documentation that these constants are defined in the JDK in header include/win32/bridge/AccessBridgePackages.h
Link to issue number:
Closes #13643
Summary of the issue:
In a Java swing application NVDA was not announcing function keys in the shortcut keys. I also suspect it was not announcing other special keys like backspace, delete, cursor keys, etc.
Description of how this pull request fixes the issue:
java access bridge defines modifier bits for function keys and control code keys and then uses specific values in the character field. This pull request checks for these bits and handles the shortcut key accordingly.
Testing strategy:
Manual and unit tests.
Known issues with pull request:
There are some keys not defined in the java access bridge constants (eg. space) and so those will be handled like normal character keys, I am not sure whether this is going to lead to correct speaking of space and similar keys. Also there are some keys which java supports but NVDA does not, these will be ignored by NVDA, as it used to.
Change log entries:
New features
Changes
Bug fixes
Fix issue where function key shortcuts were not spoken in Java swing applications.
For Developers
Code Review Checklist: