-
-
Notifications
You must be signed in to change notification settings - Fork 744
Gestures to pan screen with arrows #19478
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
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
You raise a good point. I agree that the panning step should be the same vertically and horizontally. So IMO, use zoom level (or only one dimension) to compute the size of a step. The idea is that the size of the step should vary in inverse proportion with the zoom level. |
|
So I mannaged to go without having problem without that's why the last commits are pretty much empty. I'm still working on a fix. sorry for the inconvenience |
|
Hey @Boumtchack - you can skip jobs temporarily with pre-commit by setting SKIP as an environment variable e.g. |
|
Ok but the problem, as for my last commit, the pre-commit.ci fails. And if I can run it on my computer, it actually changes the files that needs to be change and I do a clean commit after that. From github I just get a log that is not really usefull @CyrilleB79 if maybe you could pull last changes and run the |
|
@Boumtchack I cannot probably push in your branch. In any case, I have checked out the branch of this PR locally and run markdownlint-cli2 and there is no error. I do not know why the test is failed, nor how to help you. Sorry. |
|
@Boumtchack - could you ask the admins of |
seanbudd
left a comment
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.
another partial review - please make sure to review the diff and ensure everything is as expected before marking as ready
| if reachedEdge: | ||
| ui.message( | ||
| pgettext( | ||
| "magnifier", | ||
| # Translators: Message announced when arriving at the left edge. | ||
| "At left edge", | ||
| ), | ||
| ) | ||
| else: | ||
| ui.message( | ||
| pgettext( | ||
| "magnifier", | ||
| # Translators: Message announced when panning left. | ||
| "Panning left", | ||
| ), | ||
| ) |
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 agree with cyrille that this is currently too verbose. Lets just report when we hit the edge
| if reachedEdge: | |
| ui.message( | |
| pgettext( | |
| "magnifier", | |
| # Translators: Message announced when arriving at the left edge. | |
| "At left edge", | |
| ), | |
| ) | |
| else: | |
| ui.message( | |
| pgettext( | |
| "magnifier", | |
| # Translators: Message announced when panning left. | |
| "Panning left", | |
| ), | |
| ) | |
| if reachedEdge: | |
| ui.message( | |
| pgettext( | |
| "magnifier", | |
| # Translators: Message announced when arriving at the left edge. | |
| "left edge", | |
| ), | |
| ) |
| @@ -1,5 +1,5 @@ | |||
| # A part of NonVisual Desktop Access (NVDA) | |||
| # Copyright (C) 2025 NV Access Limited, Antoine Haffreingue | |||
| # Copyright (C) 2025-2026 NV Access Limited, Antoine Haffreingue | |||
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.
you generally don't need to update copyright headers unless you edit the file
| # Magnifier settings | ||
| [magnifier] | ||
| defaultZoomLevel = float(min=1.0, max=10.0, default=2.0) | ||
| defaultPanValue = integer(min=1, max=100, default=10) |
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.
| defaultPanValue = integer(min=1, max=100, default=10) | |
| defaultPanStep = integer(min=1, max=100, default=10) |
| config.conf["magnifier"]["defaultZoomLevel"] = zoomLevel | ||
|
|
||
|
|
||
| def getDefaultPanValue() -> int: |
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.
| def getDefaultPanValue() -> int: | |
| def getDefaultPanStep() -> int: |
| return config.conf["magnifier"]["defaultPanValue"] | ||
|
|
||
|
|
||
| def setDefaultPanValue(panValue: int) -> None: |
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.
| def setDefaultPanValue(panValue: int) -> None: | |
| def setDefaultPanStep(panStep: int) -> None: |
| @@ -20,40 +20,40 @@ A short video demonstration, ["What is NVDA?"](https://www.youtube.com/watch?v=t | |||
|
|
|||
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.
this entire file was erroneously reformatted. Please undo the massive reformat and ensure you have only updated the user guide to add information about panning
| @@ -0,0 +1 @@ | |||
| schemaVersion = 20 | |||
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.
this file should not have been committed
| max=100, | ||
| ) | ||
| self.bindHelpEvent( | ||
| "magnifierDefaultPan", |
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.
| "magnifierDefaultPan", | |
| "MagnifierPanStep", |
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: