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
Report keyboard shortcut when entering a list #15826
Conversation
cc: @LeonarddeR, @Emil-18 |
I think it should be displayed in braille as well, in the same way it is displayed for the focus/navigator object |
Related to |
Have you considered leaving out the list restriction. i.e. always report the shortcut key on focus entered? Can you think of any drawbacks that might cause? |
The only drawback I can think of is consumtion of time, but if it is that big of an issue for someone, they could just turn off the reporting of shortcut keys in settings anyway |
Regarding braille, I will not be able to test and work on it before next week. Is the full list also reported when the list item is selected? Also, @LeonarddeR wrote:
I have restricted to list for two reasons:
@LeonarddeR what do you think of that? Would you recommend something else? To all: |
List item is shown not list title. To see shortcut you must navigate to parent object. |
This doesn't only apply to cases in the NVDA interface, but also in other applications. |
@burmancomp wrote:
@Emil-18 wrote:
In the end, I have been able to test with the braille viewer. It seems to me that in braille, the shortcut is already present. If you cannot see it, you will probably have to pane left to see the context. |
Shortcut can be found using object navigation but when review mode is object review, it cannot be found by panning left. |
I am not speaking about object navigation. I am speaking about focus context. When I tab to the NVDA modifier list in the keyboard settings, I have the following line in the log: Of course, when the braille follows review, there is no focus context. Could you clarify what you mean when you write "when review mode is object review"? Are you speaking of a specific option? Or did I miss something else? In this case, please indicates the steps to reproduce, what you get and what you expect. Thanks. |
See test results for failed build of commit 1b8aea4afc |
You are right. When braille is tethered to focus scrolling back shows shortcut. I use braille tethered to review. When braille is tethered to review, shortcut is not shown. There may be some advantages to tether braille to review (and moving system caret when routing review cursor):
I suppose this has been possible from ms-dos times, and currently with nvda as well. It would be nice if shortcut were shown in braille also when braille is tethered to review. |
@burmancomp, shortcut keys of the current navigator object are shown when braille is tethered to review, e.g. checkbox, combo-box. In the case of list items, they have no shortcut keys. And since there is no "Nav object context" similar to focus context, the list and its shortcut is not shown in review mode except when the nav object is actually the whole list. To summarize, your request is not linked to this PR and I'd suggest that you open a specific new issue to clarify the need, what you get today and what you would expect. |
@@ -774,7 +774,8 @@ def _objectSpeech_calculateAllowedProps(reason, shouldReportTextContent): | |||
} | |||
if reason in (OutputReason.FOCUSENTERED, OutputReason.MOUSE): | |||
allowProperties["value"] = False | |||
allowProperties["keyboardShortcut"] = False | |||
if not objRole == controlTypes.Role.LIST: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should speak shortcuts for any object that focus enters. I cannot remember specifically why we never originally did. If you can make an argument for lists, I think you can for any other container. Most likely this was simply that early on it was only done for focus and not focusEntered, and then when later abstracted, it was deliberately removed from focusEntered to match existing behaviour.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should speak shortcuts for any object that focus enters. I cannot remember specifically why we never originally did. If you can make an argument for lists, I think you can for any other container. Most likely this was simply that early on it was only done for focus and not focusEntered, and then when later abstracted, it was deliberately removed from focusEntered to match existing behaviour.
@michaelDCurran, this has just been discussed with @LeonarddeR in #15826 (comment), #15826 (comment) and #15826 (comment).
The group container can have a shortcut key defined but actually not working. To avoid to get other such not working case, it seems safer to restrict this PR to the only known, frequent and useful case of lists. If in the future we can find other containers for which the shortcut key should be announced, we may include their role too.
Or should I instead exclude explicitly the case of grouping which is not working?
A third possibility can be to remove this filtering and consider that putting a shortcut key in grouping where it does not work should not be done in first place by the developer of the application.
@michaelDCurran, let me know which solution you would prefer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whether authors place a shortcut on groupings, or whether these shortcuts actually work on groupings in applications really is separate to this pr I feel. However, your current solution solves your immediate problem, and does not introduce other known problems. Therefore, could you please at least add a comment above this line stating why we only do it for list at this stage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Done in 43c500e.
source/speech/speech.py
Outdated
@@ -745,7 +745,7 @@ def getObjectSpeech( | |||
return sequence | |||
|
|||
|
|||
def _objectSpeech_calculateAllowedProps(reason, shouldReportTextContent): | |||
def _objectSpeech_calculateAllowedProps(reason, shouldReportTextContent, objRole): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add type hints here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in acaeeee.
You are right. After thinking this, I agree. Showing list shortcut in braille when braille is tethered to review, requires considerationn (at minimum what and when should be displayed), and I have no opinion about this at the moment. So I also prefer separatehandling of showing list shortcut when braille is tethered to review. If on the whole it seems to be useful feature, I suppose that then I or somebody else will likely open issue or discussion. |
Link to issue number:
Closes #15816
Summary of the issue:
When the focus enters in a list, the list's keyboard shortcut is not reported. It's because a list item takes the focus, whereas the shortcut key is on the whole list; logically, individual list items have no shortcut. We usually do not report shortcut keys when entering container objects. However, in the case of list, it would be useful so that people know that the list has a shortcut key.
Description of user facing changes
Reports shortcut when the focus enters a list.
Description of development approach
When speaking an object for
FOCUS_ENTERED
reason, if the object is a list, we do not discard keyboard shortcut anymore.While at it, removed the accelerator of path selection in the "Create portable NVDA" dialog, since I have realized during the investigation for this PR that it was not working. A better solution would be to have a working key accelerator for this field but I do not know how to do this.
Testing strategy:
Manually tested the lists in #15816 (comment).
Known issues with pull request:
None
Code Review Checklist: