Skip to content

NVDAObjects.UIA: introduce UIA is grabbed property handler#14097

Merged
seanbudd merged 3 commits into
nvaccess:masterfrom
josephsl:UIAIsGrabbedProperty
Sep 2, 2022
Merged

NVDAObjects.UIA: introduce UIA is grabbed property handler#14097
seanbudd merged 3 commits into
nvaccess:masterfrom
josephsl:UIAIsGrabbedProperty

Conversation

@josephsl

@josephsl josephsl commented Sep 2, 2022

Copy link
Copy Markdown
Contributor

Hi,

First part of two-part pull request series to handle keyboard-based accessible drag and drop powered by UI Automation, ultimately deriving from #12271 work:

Link to issue number:

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.

Testing strategy:

Manual and add-on based testing:

Prerequisites: a Windows 10 system.

  1. Add UIA is grabbed property to states to be handled by UIA NVDA objects.
  2. Create a binary build of NVDA locally, preferably on a Windows 10 system.
  3. Run the just created binary copy of NVDA on a Windows 10 computer.
  4. Open Start menu, press Shift+Tab to move to tiles.
  5. Select any tile, then press Alt+Shift+arrow keys to rearrange them.

Before the PR: NVDA does not announce anything.
After the PR: NVDA says "dragging".

Known issues with pull request:

This does not address another drag and drop events set, namely drop target enter/leave/dropped events, nor announces drag drop effect (a separate property must be handled). A follow-up pull request, designed to address these known issues in one go, is on its way. A resolution to the issues described is part of latest development builds of Windows App Essentials add-on.

Change log entries:

Bug fixes (or can go under new features):

NVDA will announce dragging state when a UI Automation control is about to be dragged via mouse or keyboard, notably when rearranging tiles in Windows 10 start menu. (#14081)

Code Review Checklist:

  • Pull Request description:
    • description is up to date
    • change log entries
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • API is compatible with existing add-ons.
  • Documentation:
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • Security precautions taken.

…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.
@josephsl josephsl requested a review from a team as a code owner September 2, 2022 01:03
@josephsl josephsl requested a review from seanbudd September 2, 2022 01:03
@seanbudd seanbudd added this to the 2022.2.3 milestone Sep 2, 2022
@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 7a8a4c4836

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 7a8a4c4836

@seanbudd seanbudd merged commit 51f5a38 into nvaccess:master Sep 2, 2022
seanbudd pushed a commit that referenced this pull request Sep 5, 2022
…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).
@josephsl josephsl deleted the UIAIsGrabbedProperty branch October 8, 2022 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NVDAObjects.UIA: let NVDA recognize drag and drop states based on IsGrabbed property

3 participants