Skip to content

Commit a66e8da

Browse files
authored
Merge 0b8adbc into 92244b9
2 parents 92244b9 + 0b8adbc commit a66e8da

3 files changed

Lines changed: 45 additions & 11 deletions

File tree

source/NVDAObjects/UIA/__init__.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2055,6 +2055,37 @@ def event_UIA_itemStatus(self):
20552055
ui.message(f"{self.name} {itemStatus}")
20562056
self._itemStatusCache = itemStatus
20572057

2058+
def event_UIA_dragDropEffect(self):
2059+
# UIA drag drop effect was introduced in Windows 8.
2060+
try:
2061+
ui.message(self._getUIACacheablePropertyValue(UIAHandler.UIA_DragDropEffectPropertyId))
2062+
except COMError:
2063+
pass
2064+
2065+
def event_UIA_dropTargetEffect(self):
2066+
# UIA drop target effect property was introduced in Windows 8.
2067+
try:
2068+
dropTargetEffect = self._getUIACacheablePropertyValue(
2069+
UIAHandler.UIA_DropTargetDropTargetEffectPropertyId
2070+
)
2071+
except COMError:
2072+
dropTargetEffect = ""
2073+
# Sometimes drop target effect text is empty as it comes from a different object.
2074+
if not dropTargetEffect:
2075+
for element in reversed(api.getFocusAncestors()):
2076+
if not isinstance(element, UIA):
2077+
continue
2078+
try:
2079+
dropTargetEffect = element._getUIACacheablePropertyValue(
2080+
UIAHandler.UIA_DropTargetDropTargetEffectPropertyId
2081+
)
2082+
except COMError:
2083+
dropTargetEffect = ""
2084+
if dropTargetEffect:
2085+
break
2086+
if dropTargetEffect:
2087+
ui.message(dropTargetEffect)
2088+
20582089

20592090
class TreeviewItem(UIA):
20602091

source/UIAHandler/__init__.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -169,19 +169,22 @@
169169
}
170170

171171
UIAPropertyIdsToNVDAEventNames={
172-
UIA_NamePropertyId:"nameChange",
173-
UIA_HelpTextPropertyId:"descriptionChange",
174-
UIA_ExpandCollapseExpandCollapseStatePropertyId:"stateChange",
175-
UIA_ToggleToggleStatePropertyId:"stateChange",
176-
UIA_IsEnabledPropertyId:"stateChange",
177-
UIA_ValueValuePropertyId:"valueChange",
178-
UIA_RangeValueValuePropertyId:"valueChange",
179-
UIA_ControllerForPropertyId:"UIA_controllerFor",
180-
UIA_ItemStatusPropertyId:"UIA_itemStatus",
172+
UIA.UIA_NamePropertyId: "nameChange",
173+
UIA.UIA_HelpTextPropertyId: "descriptionChange",
174+
UIA.UIA_ExpandCollapseExpandCollapseStatePropertyId: "stateChange",
175+
UIA.UIA_ToggleToggleStatePropertyId: "stateChange",
176+
UIA.UIA_IsEnabledPropertyId: "stateChange",
177+
UIA.UIA_ValueValuePropertyId: "valueChange",
178+
UIA.UIA_RangeValueValuePropertyId: "valueChange",
179+
UIA.UIA_ControllerForPropertyId: "UIA_controllerFor",
180+
UIA.UIA_ItemStatusPropertyId: "UIA_itemStatus",
181+
UIA.UIA_DragDropEffectPropertyId: "UIA_dragDropEffect",
182+
UIA.UIA_DropTargetDropTargetEffectPropertyId: "UIA_dropTargetEffect",
181183
}
182184

183185
globalEventHandlerGroupUIAPropertyIds = {
184-
UIA.UIA_RangeValueValuePropertyId
186+
UIA.UIA_RangeValueValuePropertyId,
187+
UIA.UIA_DropTargetDropTargetEffectPropertyId,
185188
}
186189

187190
localEventHandlerGroupUIAPropertyIds = (

user_docs/en/changes.t2t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Note there are still known issues with Chrome and Edge. (#13254)
5757
-
5858
- NVDA will announce UIA item status property changes in places such as the Visual Studio 2022 create app packages dialog. (#13973)
5959
- Orientation state (landscape/portrait) changes are now correctly ignored when there is no change (e.g. monitor changes). (#14035)
60-
- 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)
60+
- NVDA will announce dragging items on screen in places such as rearranging Windows 10 Start menu tiles and virtual desktops in Windows 11. (#12271, #14081)
6161
-
6262

6363

0 commit comments

Comments
 (0)