Added mouse wheel scrolling commands#16462
Conversation
|
Here are some things I'm not sure about yet:
|
See test results for failed build of commit ac5a0ac7a4 |
|
@cary-rowen nice feature, thanks very much for this great contribution.
I think 2024.2 will not take additional change log entris from alpha. But better we wait for NV Access confirmation on that.
NVDA should read out what is under the mouse cursor, as it does when moving the mouse. Also we need to test if the review cursor is moved properly when it follows the mouse. You can enable this in the review cursor settings. Did you test this already? |
|
Re the change log: |
Note that this is not the same behavior as actually scrolling the physical scroll wheel. |
LeonarddeR
left a comment
There was a problem hiding this comment.
As for the gestures, I would personally vote against gestures that do not involve the NVDA key. I'm also not convinced that these gestures need assignments by default. Both UIA and IAccessible2 have the ability to instruct objects to scroll into view.
That said, I think this is certainly a valuable feature!
|
Happy to see this feature!
I also would prefer that NVDA core avoid gestures that do not include the NVDA key.
For me, assigning these gestures are fine, if they include NVDA key also.
|
|
Thanks to @LeonarddeR for the code review. @LeonarddeR and @XLTechie I assigned it a gesture with NVDA keys, NVDA+Windows+pageUp/Down hoping this would be more useful, I'd also like to hear what the community has to say. Hi @Adriani90
This PR is intended to emulate the scroll wheel functionality on a physical mouse, which does not behave exactly like a mouse pointer.
No problem, I will do it. |
|
The need to scroll seems quite rare; personally, I would not have assigned it any keyboard shortcut. |
|
Scrolling the wheel is probably rarer than moving the mouse pointer, I'd be willing to have the default gesture removed. |
See test results for failed build of commit 20ccf7889e |
source/globalCommands.py
Outdated
| category=SCRCAT_MOUSE | ||
| ) | ||
| def script_scrollMouseWheelDown(self, gesture): | ||
| mouseHandler.scrollMouseWheel(-winUser.WHEEL_DELTA, True) |
There was a problem hiding this comment.
| mouseHandler.scrollMouseWheel(-winUser.WHEEL_DELTA, True) | |
| mouseHandler.scrollMouseWheel(-winUser.WHEEL_DELTA, isVertical=True) |
|
Can you please update the description to reflect the latest changes e.g. note that the gestures are unbound |
source/globalCommands.py
Outdated
| @script( | ||
| description=_( | ||
| # Translators: Input help mode message for mouse wheel scroll up command. | ||
| "Scrolls up the mouse wheel at the current mouse position" |
There was a problem hiding this comment.
Technically, I think that you do not scroll the mouse but the window's content at the mouse position, e.g. you scroll a webpage.
English native speakers, please confirm.
| "Scrolls up the mouse wheel at the current mouse position" | |
| "Scrolls up at the current mouse position" |
There was a problem hiding this comment.
Yes, most of the time it's not the mouse wheel itself that's scrolling, but rather the content on the screen (such as a web page or document) that moves in response to the mouse wheel's operation.
However, from a technical implementation perspective, this is the result of simulating the behavior of a mouse wheel scrolling.
The function doesn't move the content directly; it generates mouse wheel events that the system interprets as commands to scroll the content.
Can other native English speakers offer more advice on this?
There was a problem hiding this comment.
Yes I think this terminology is better for these descriptions
There was a problem hiding this comment.
Do you mean I don't need to make changes or should I take @CyrilleB79's suggestion?
There was a problem hiding this comment.
@cary-rowen, if you are concerned by the fact that the function does not move the content directly, do not use scroll at all, because the function does not actually perform scrolling, it actually simulate wheel rotating.
| "Scrolls up the mouse wheel at the current mouse position" | |
| "Rotates up the mouse wheel at the current mouse position" |
IMO, no need to mention "simulation", as done also for left/right mouse click. Indeed, assigning a keyboard or touch gestures already makes clear that the real action is not done by the physical mouse.
There was a problem hiding this comment.
@Qchristensen - what are your thought on the changes from scrolling to rotating? I prefer scrolling and think its more common. Rotating to me seems to imply physical movement of the wheel, not the behaviour on screen.
There was a problem hiding this comment.
I agree that the verb "to scroll" is more common and probably more understandable.
Actually, my concern with the initial wording was that "to scroll up the mouse wheel" was not correct grammatically. Why not things like:
- "scroll up at the mouse position" for descriptions / comments
- "mouseScrollUp" for the script's name?
No matter if we do not mention the word "wheel", which create confusion or bad phrasing when used with "scroll".
There was a problem hiding this comment.
No matter if we do not mention the word "wheel", which create confusion or bad phrasing when used with "scroll".
I don't entirely agree with this.
I have attached a Microsoft document before. Can we refer to some of the wording in it?
There was a problem hiding this comment.
But "scrolling" is actually a key word present in the documentation you linked (first table, in the column "Action")
IMO, when possible, it's better to mention an action rather than a physical button, because there may be other ways to perform them.
For example:
- use "scroll up/down" rather than "rotate the mouse wheel up/down" because there may be other way to perform these actions, e.g. with a touch pad.
- use "scroll left/right" rather than "rotate the mouse wheel left/right because in Chrome you can scroll horizontally using shift + rotating vertically the mouse wheel.
source/globalCommands.py
Outdated
| ), | ||
| category=SCRCAT_MOUSE | ||
| ) | ||
| def script_scrollMouseWheelUp(self, gesture): |
There was a problem hiding this comment.
Idem:
| def script_scrollMouseWheelUp(self, gesture): | |
| def script_scrollUpAtMousePosition(self, gesture: inputCore.InputGesture) -> None: |
source/mouseHandler.py
Outdated
| @@ -379,3 +379,32 @@ def unlockRightMouseButton(): | |||
| # Translators: This is presented when the right mouse button lock is released (used for drag and drop). | |||
| ui.message(_("Right mouse button unlock")) | |||
There was a problem hiding this comment.
I know this is old, but...
| ui.message(_("Right mouse button unlock")) | |
| ui.message(_("Right mouse button unlocked")) |
I would like to do the left one as well, but when expanding up to it, GH won't allow a change suggestion.
|
Thanks to @XLTechie for the English wording suggestion. |
|
@seanbudd I think this is ready. |
|
@cary-rowen has been there any testing with the visual highlighter on? What happens when the highlighters are enabled? Do they disappear from the screen when scrolling the wheel with the keyboard commands? Or do they get a new position? |
I'm not testing it right now. |
|
cc @Qchristensen |
|
Just looking at the User Guide change rather than the code comment, I see line 840 has: |Rotates the mouse wheel up at the current mouse position| I would go with "scroll", and yes I agree with "up" where it is in this sentence rather than where it was earlier in the conversation. While the previous suggestion of "Scroll up at the current mouse position" is shorter, I'm not against "Scroll the mouse wheel up" as it does indicate what is trying to be scrolled at this point, as opposed to the several other instances of scrolling commands in NVDA, eg:
|
|
@Qchristensen |
|
Hi cc @seanbudd |
Qchristensen
left a comment
There was a problem hiding this comment.
Looks good, thanks Cary and everyone!
Link to issue number:
Closes #15484
Summary of the issue:
Some dynamically loaded web pages and desktop applications, such as Dism++, only allow scrolling via the hardware mouse wheel to display more content. NVDA can only interact with these through screen review mode. However, to load more items, mouse wheel usage is required.
Description of user facing changes
This pull request allows users to simulate mouse wheel scrolling through gestures. Added four commands with no gestures assigned:
Description of development approach
I created a function within
mouseHandlercalledscrollMouseWheel, which scrolls the mouse wheel either vertically or horizontally, controlling the scroll direction and amount. For more information about mouse events, see WM_MOUSEWHEEL.It's important to note that this function limits the scrolling per execution to
winUser.WHEEL_DELTA(120) or less. Although this PR performs the standard scrolling amount of 120 each time, add-on developers might opt for a larger amount, as done by @beqabeqa473 in mouseWheelScrolling.Testing strategy:
I tested the following cases:
Go to System Settings > Devices > Mouse > Roll the mouse wheel to scroll:
Known issues with pull request:
Microsoft Excel correctly responds to system settings, whether "Multiple lines at a time" or "One screen at a time".
However, the slider in the NVDA voice settings panel always scrolls at the standard amount of 120 and does not respond to system settings, but is consistent with the behavior of physical mouse wheel.
Code Review Checklist: