Gestures to pan screen with arrows#19478
Gestures to pan screen with arrows#19478Boumtchack wants to merge 24 commits intonvaccess:masterfrom
Conversation
|
I implemented NVDA+alt+arrows gestures for step by step panning, the values can be changed, there is a min/max/step variables that can be modified. I choosed to force the mouse to stay in the middle of the magnifier window so if someone decides to move it, there won't be a sudden jump of the window. I'm open to any modifications |
There was a problem hiding this comment.
Pull request overview
This PR adds keyboard gestures for panning the magnifier screen, allowing users who don't use a mouse to navigate the magnified view. The implementation includes customizable pan values and edge detection for boundary awareness.
Changes:
- Added 8 new keyboard gestures (4 directional pans + 4 edge pans) with NVDA+Alt+Arrow combinations
- Introduced configurable pan value setting with range from 10-100 pixels
- Implemented pan margin calculation and boundary detection logic
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| source/config/configSpec.py | Adds defaultPanValue configuration option with min/max constraints |
| source/_magnifier/config.py | Implements PanValue class with pan_range and pan_strings methods, plus getter/setter functions |
| source/_magnifier/magnifier.py | Adds _panValue field, setPanMarginBorder method, and _pan method for panning logic |
| source/_magnifier/utils/types.py | Defines 8 new MagnifierAction enum values for pan operations |
| source/_magnifier/commands.py | Implements 8 command functions for panning operations with user feedback |
| source/globalCommands.py | Registers 8 script handlers with keyboard gesture bindings |
| source/gui/settingsDialogs.py | Adds pan value dropdown to magnifier settings panel |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Please fill out the PR description in full and address CoPilot's review |
|
Do these really need four default gestures? |
IMO yes. These commands are mandatory for any Magnifier user who does not use the mouse. IMO these gestures are much more useful than than gestures to toggle focus tracking mode or to cycle through filters. What would you suggest instead? Leave them unassigned, or something else? |
seanbudd
left a comment
There was a problem hiding this comment.
Thanks @Boumtchack - this is just a partial review. Would also like @CyrilleB79's thoughts around panning grain
|
I have done some tests on this PR.
|
I have tried getting this problem but it works fine for me, have you some settings that are not default that could be the reason of this issue?
If I understand correctly, it we would change the pan steps value by a % step value so it feels the same for the user regardless of the zoom level?
I guess there is a default bip sound for the good execution of a command? also I've tried to hold the command to pan at 1px and it sounds awfull, I don't know if having a bip would be better, but maybe no one will just hold down the panning command. I would still keep the arrived to edge ones
yes I don't mind that |
I do not think so: I have tested with a brand new NVDA config with only few changes.
Yes, exact.
Do you mean in NVDA in general? (the answer is no) Or just about panning commands? (I cannot hear them; can you point in the code where it is located). Maybe we should first wait this PR to be merged and have people experimenting with it before we decide what the most desirable audio feedback upon panning commands would be.
Yes, when I set step to 1px and hold panning keys pressed, I just hear the beginning of the word "Panning" repeated again and again, what is not very desirable. With windows Magnifier + Windows Magnifier add-on, I sometimes hold panning keys (control+alt+arrows) to go faster. So with Windows Magnifier, it was clearly a real use case. I have configured Windows Magnifier feedback to beep on panning commands. It gives useful information. But I agree that:
Alternatively, one can imagine the Zoomtext panning command approach which is much nicer from UX point of view.
That's an example and steps 2 and 3 can be omitted, or can also be repeated to increase or decrease the panning speed. Though, such key commands may not fit well easily with NVDA input gestures system. So if possible, this may be thought and discussed in a separate subsequent issue and PR.
Do you mean that you would keep the spoken message? |
|
I think the audio issue could be discussed more thoroughly in an other PR with a proper issue. I came accross an other problem, in my opinion is that if we deal with percents, panning top and right won't have the same value as screens are not squares, so it might feel a little weird. For the message I changed it to "at top edge" as suggested by Sean |
|
@Boumtchack - could you ask the admins of |
seanbudd
left a comment
There was a problem hiding this comment.
another partial review - please make sure to review the diff and ensure everything is as expected before marking as ready
|
@Boumtchack - can you resolve merge conflicts from #19483 ? |
|
Thinking again about edge messages, I think that there are two options about what should be reported.
Said otherwise, do these command need to report:
Opting for 1. allows to provide a confirmation feedback that the user has used a jump command (instead of just a move command). On the opposite, opting for 2. provides additional useful information, i.e. indicates if the user was already on left edge or not; option 2. is the same approach as review cursor moving, e.g. |
…zoomPanningGesture
|
What I will do is remove the verbose for the pannings so we can focus on the gesture on this PR, for any verbose or sound request we can open an other one, maybe it would be easier? |
I've managed to install it but I have issues making it work in PR for your repository. the only way for me to make it work would be to push to my master branch and make PR from this, but it does not feel like a good way to do it. |
d672caf to
203c685
Compare
| pgettext( | ||
| "magnifier", | ||
| # Translators: Message announced when zooming in with {zoomLevel} being the target zoom level. | ||
| "Zooming in with {zoomLevel} level", |
There was a problem hiding this comment.
Instead of making this a function, just save the text to a variable, and call ui.message(_ZOOM_LEVEL_MSG.format(zoomLevel=zoomLevel)
| "Zooming in with {zoomLevel} level", | |
| "Zooming to {zoomLevel}x", |
There was a problem hiding this comment.
Since you are modifying this code, I'd suggest something still shorter than @seanbudd's suggestion:
| "Zooming in with {zoomLevel} level", | |
| "{zoomLevel}x", |
Indeed, this message is short, thus efficient, but remain understandable, i.e. we know that it deals with a level modification. The only information we lose is is the zoom direction (in or out), but that's not a problem IMO because:
- the user probably knows which key they have pressed
- a user who needs a confirmation of the pressed key can enable speaking of command keys (NVDA+4)
- in case the direction was wrong, the user can zoom in the other direction without any side consequence.
Moreover, having the most useful information (zoom level value) at the beginning of the message is much more useful, especially when the command can be repeated various times in a row.
More generally, I think that NVDA command feedback need to be short, especially in the case of the magnifier where the visual channel can partially help the user to understand what's on.
Note: This is somewhat off-topic for this PR, but since you are modifying these messages here, I've decided to comment anyway.
| :return: True if an edge message should be announced, False otherwise. | ||
| For normal pan actions: True when reaching the edge (first contact). | ||
| For edge pan actions: True when already at the edge (bumping). |
There was a problem hiding this comment.
I dont think we should frame this as "edgeMessage" instead as "hasMoved".
Let's only announce the message when bumping, not first contact.
i.e. let's only return True if the pan causes a move, otherwise False if the pan view doesn't move
|
|
||
| def sayEdgeMessage(edge: str): | ||
| """Annonce wich edge reached.""" | ||
| ui.message( |
There was a problem hiding this comment.
same here with using a constant
| pgettext( | ||
| "magnifier", | ||
| # Translators: Message announced when arriving at the left edge. | ||
| f"{edge} edge", |
There was a problem hiding this comment.
f-strings dont work in pgettext
| f"{edge} edge", | |
| "{edge} edge", |
Link to issue number:
Fixes #19471
Summary of the issue:
Users who doesn't use mouse were needing a way to move the screen
Description of user facing changes:
8 new gestures to learn for panning magnifier window
Description of developer facing changes:
N/A
Description of development approach:
Adding 8 new gestures:
Testing strategy:
Known issues with pull request:
Code Review Checklist: