-
-
Notifications
You must be signed in to change notification settings - Fork 678
NVDAObjects.UIA: let NVDA recognize drag and drop states based on IsGrabbed property #14081
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
Comments
People who might be interested: @LeonarddeR, @codeofdusk, other UIA users. ONly after introducing drag/drop patterns to object states can a reimplementation of #12271 commence (I think it would make sense to not mess with gain focus events anymore as I have learned some things over the years that makes focus event queueing not worth it now). |
Hi, Actualy, a simpler approach exists: UIA_IsGrabbedPropertyId (issue title changed). Thanks. |
I'm working on this and one issue I'm encountering is that IsGrabbed property only changes when dragging using the mouse, using the keyboard doesn't change it. |
Hi, there is one place where you can test this with keyboards: Windows 10 Start menu tiles, specifically when rearranging tiles by pressing Alt+Shift+arrow keys. I have a working implementation, but I can wait a while (my implementation involves listening to drag start UIA event). Thanks.
|
Yes, that's what I'm doing, it gets dragged and dropped but no grabbing property while holding alt + shift like how when the left button on the mouse is held down over an item. |
Hi, Interesting. The way I resolved this in Windows Ap Essentials add-on (privately testing in canary channel a.k.a. source code level) is to map UIA drag start event to state change event, then in state change event inside the global plugin part of the add-on, check if is grabbed property is set and add "dragging" state to obj.states set. By the time UIA object gets to handle state change event (nextHandler function), NVDA will announce "dragging". But this is only one part of the puzzle: the other part, to be raised in a separate issue and will be addressed at the same time as this one, involves listening to UIA drag drop effect property changes and announcing the progress of drag drop process (same as Narrator). There is one last component which might be addressed in a separate PR: letting NVDA announce "done dragging" when drag and drop completes (this involves listening to UIA drag complete event). This whole algorithm responds to drag drop events set - there is another algorithm involved in listening to drop target events, which is not exacly the same thing as drag drop events set but somewhat related (that one will (finally) address NVDA not announcing placement progress when rearranging a variety of things, most notably Windows 10/11 quick actions). All these will be packaged as part of August 31st dev build of Windows App Essentials and may show up as part of 22.10 to stable channel subscribers in a few weeks. So I propose that we compare our notes and see if we can come up with a common implementation (I think it would be better (in the long term) for me to step aside). Thanks. |
Hi, As for translating this into NVDA Core, this will involve editing at least two files: UIAHadler/init.py, and NVDAObjects/UIA/init.py. The former will add a few events and properties to UIA events/properties to NVDA events maps, and the latter will handle "is grabbed" property and map it to object states (NVDAObjects.UIA.UIA._get_states). Thanks. |
The way I tried to resolve this is I mapped the property directly to stateChanged |
Hi, it will work if drag start event is also mapped to state change event. Thanks.
|
Just tried that, state is announced with mouse, with keyboard it is grabbed but nothing. |
Hi, okay, just to make sure we are on the same page: are you talking about rearranging taskbar icons in Windows 11, or rearranging Start menu tiles in Windows 10? If the former, then I’m afraid that the latest dev build of Windows App Essentials add-on might not help; if the latter, then the latest add-on dev build will address it. The implementation I described is part of latest Windows App Essentials add-on development build (August 31st build, that is) – not officially committed to Git repo as I want to test the idea before officially committing to it (which I might do once I feel better from the latest seasonal headache). Thanks.
|
I've just tried latest windows app essentials addon from git and it has the same issue as my implementation. |
…s#14081. When elements are about to be dragged, UIA sets 'IsGrabed' property to True. Add this property to UIA object states set so it can be detected and announced by NVDA (announcement is next commit).
… Re nvaccess#14081. Treat 'is grabbed' property chnages as state changes. This will result in NVDA saying 'dragging' when items are grabbed, most notably when rearranging tiles in Windows 10 start menu.
Closes #14081 Summary of the issue: NVDA does not recognize if a UIA element is about to be dragged when using keyboards. Description of user facing changes When a UIA element such as Windows 10 Start menu tile is about to be dragged and rearranged, NVDA will say "dragging" to indicate the dragging state. Description of development approach Add UIA "IsGrabbed" property to list of states to be handled by UIA objects, and map drag start UIA event to state change event. * NVDAObjects.UIA: add support for UIA 'IsGrabbed' property. Re #14081. When elements are about to be dragged, UIA sets 'IsGrabed' property to True. Add this property to UIA object states set so it can be detected and announced by NVDA (announcement is next commit). * UIA handler: map UIA is grabbed property event to state change event. Re #14081. Treat 'is grabbed' property chnages as state changes. This will result in NVDA saying 'dragging' when items are grabbed, most notably when rearranging tiles in Windows 10 start menu. * update changes Co-authored-by: Sean Budd <sean@nvaccess.org>
…nge events. Re nvaccess#14081. Without defining UIA drag cancel and complete events, NVDA will not nanounce 'dragging' when dragging the selected item a second time (the added events do allow flushing staes cache as part of state change event, although NVDA will not nanounce 'done dragging' which is somethig to be investigated in the future).
Hi, Update: a follow-up pull request is on its way - adding and mapping UIA drag cancel and complete events to state changes. |
…nge events. Re #14081. (#14104) Additional fix for #14081 Follow-up to #14097 Summary of the issue: NVDA is not announcing "dragging' when the item being dragged is let go and dragged again. Description of user facing changes When the item is grabbed a second tie, NVDA will announce 'dragging'. Description of development approach Add and map UIA drag cancel and complete events to state changes. This allows UIA object states cache to reflect the fact that "is grabbed" property is False, allowing NVDA to announce "dragging" when the item is grabbed again. At the moment NVDA will not say "done dragging" when drag complete event fires - that might be something to investigate in the future (remapping drag cancel/commplete events or doing soething with state change event/speech output). Without defining UIA drag cancel and complete events, NVDA will not nanounce 'dragging' when dragging the selected item a second time (the added events do allow flushing staes cache as part of state change event, although NVDA will not nanounce 'done dragging' which is somethig to be investigated in the future).
Hi, it will announce dragging state from keyboard if the element supports “is grabbed” property, the best place to test it being Windows 10 Start menu – I haven’t found a place in Windows 11 where it works properly. Activities such as rearranging quick settings items will yield drop target events instead, not drag start/cancel/complete events, hence our work only addresses part of the issue. I’m about to publish a pull request, and I’ll mention your ID there and let me know if that’s the implementation you’ve got, in which case we might as well combine our thought processes. Thanks.
|
…vent. Re #12271. (#14278) Link to issue number: Follow-up to #12271 Follow-up to #14081 Summary of the issue: Follow-up/quick fix engineering for drag and drop effect announcement: suppose a user moves the mouse to an object that: is a UIA element, supports drag and drop, and is not a system focus. When drag and drop operation starts, drag drop effect is not announced, caused by the drag drop effect not being a global property event. Description of user facing changes Drag drop effect will be announced when performing drag and drop operation via mouse regardless of system focus, similar to drop target effect announcement. Description of development approach Add UIA_DragDropEffectPropertyId to global properties list to align with drop target effect property. Follow-up/quick fix engineering for drag and drop effect announcement: suppose a user moves the mouse to an object that: is a UIA element, supports drag and drop, and is not a system focus. When drag and drop operation starts, drag drop effect is not announced, caused by the drag drop effect not being a global property event. Beta branch justification: this is a bug fix/new feature introduced in NVDA 2022.4. Subsequent testing indicate that drag drop UIA property should have been a global property so the property can be announced based on mouse actions, simiar to reporting mouse when mouse tracking is turned on via mouse settings panel. This change also aligns with drop target effect announcement as drag and drop announcement issue covers both.
Hi,
This issue stems from #12271
Is your feature request related to a problem? Please describe.
NVDA objects representing UIA elements can expose UIA patterns through dev info facility (NVDA+F1). While some patterns are mapped to object states, a number of useful patterns to states mapping are missing.
A prominent group of patterns relate to drag and drop. Specificaly, UIA elements can expose drag and drop target patterns for use by assistive technologies to inform users about draggable items. This is used in Narrator and NVDA (the latter via an add-on) to notify users about drag and drop target operations such as rearranging virtual desktops on Windows 11, placing Start menu times in Windows 10, and managing apps and folders in Windows 11 Version 22H2 Start menu. While these patterns are exposed by elements, they are not mapped to drag and drop target states yet.
Describe the solution you'd like
Since NVDA does come with drag and drop target states in control types package, let UIA NVDA objects add drag/drop target states based on exposed patterns.
Describe alternatives you've considered
None - cannot be done easily via add-ons as it touches NVDAObjects.UIA.UIA._get_states getter.
Additional context
This issue came from discussions surrouding #12271 as the pull request for it was unmanageable and led to user experience issues. Therefore, this issue serves as a starting point for resolving the mentioned issue in a series of pull requests to make the work more manageable.
Tanks.
The text was updated successfully, but these errors were encountered: