Repository: nvaccess/nvda

Issue:
Windows 10: Time picker values are not announced
**Reported by nvdakor on 2015-07-18 07:13**
Hi,
A number of apps uses so-called time picker to select hour, minute, period and so on. So far, this appears when creating new alarms in the Alarms and Clock app and when selecting the time to restart to finish installing updates. For these controls, NVDA does not announce values as the picker changes.
STR:
1. Open an app that uses time picker controls such as Alarms.
2. If Alarms app is opened, select New, then type the name for an alarm.
3. Press TAB to move to the time picker. Press ENTER to begin interacting with it, and use up and down arrows to change values. In case of Alarms, the first picker will be hour selector.
Expected: NVDA announces values when one presses up or down arrows to select an item from a time picker.
Actual: Value isn't announced.

Technical: Yet another UIA friend. Thankfully, developer info says it has class name of LoopingSelector (doesn't matter which selector we're dealing with, as it'll have different cached class name but they are really LoopingSelector controls). Also, NVDA says it is a list when it might be best to classify it as a slider (I think reclassifying it as a slider might be the easiest solution). I'll do some more investigation into this guy.
Thanks.



Discussion:
Attachment time.py added by nvdakor on 2015-07-22 07:24
Description:
A proof of concept app module for Alarms and Clock app (time.py) that announces selected time picker items.

Comment 1 by nvdakor on 2015-07-22 07:00
Hi,
Further investigation shows the following:
- The actual item we are interested in has class name of LoopingSelectorItem.
- According to Accevent, a selection event is fired when I press arrow keys to select values from time pickers. This suggests we can borrow selection event from Start Screen search box (searchui.py).
- One issue is that current time picker value is not announced when focus moves to the next or previous time picker control. This suggests we need to perhaps route the navigator object to the original item when focus moves to the time picker.
- A variation of this looping control can be found in Windows 8.x (Alarms app has a weird slider similar to what we are dealing with here except it announces percents instead of time).
  I'll attach an app module that may fix this issue for Alarms and Clock app where LoopingSelector/LoopingSelectorItem lives. However, the general solution might be to add looping selector item into NVDAObjects.UIA package to deal with looping selectors in other areas such as Settings/System/Windows Update in Windows 10.
  Thanks.

Comment 2 by Joseph Lee &lt;joseph.lee22590@... on 2015-08-25 02:54
In [812b1f24693d7abfaf6cbbfb4858e23fbd9e342b]:
```CommitTicketReference repository="" revision="812b1f24693d7abfaf6cbbfb4858e23fbd9e342b"
UIA: Make sure to announce time selector items when values change such as those found in Alarms and Clock app and when selecting a time to install Windows Updates. re #5231

```
```

Hi,

Coming back to this ticket...

During a conversation with @JCSTeh, possibility of integrating support for Alarms and Clock and other apps into NVDA core was brought up. Thankfully, Windows 10 App Essentials add-on has a pull request quality code for looping selector items.

Thanks.
@josephsl: Is the needs code review label still valid for this issue?
Hi, yes, until the PR appears and/or accepted. I’m being careful with looping selectors, as they can change between Windows 10 releases and across apps. Thanks.

 

From: Leonard de Ruijter [mailto:notifications@github.com] 
Sent: Saturday, July 15, 2017 12:50 AM
To: nvaccess/nvda <nvda@noreply.github.com>
Cc: Joseph Lee <joseph.lee22590@gmail.com>; Mention <mention@noreply.github.com>
Subject: Re: [nvaccess/nvda] Windows 10: Time picker values are not announced (#5231)

 

@josephsl <https://github.com/josephsl> : Is the needs code review label still valid for this issue?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <https://github.com/nvaccess/nvda/issues/5231#issuecomment-315517390> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AHgLkN87F6sHwChRZ7rsvxMCBHafrMu3ks5sOG8NgaJpZM4NnKJE> .


Dropping needsCodeReview, as @josephsl will be able to submit a PR if/when he wishes. Thanks.
When creating an Alarm, the value does seem to get announced for me when I use the arrow keys in the lists. This is possibly the result of another recent fix. The current value isn't announced when focusing the list, though.

P3 because it's possible to work around this, but it's annoying/inefficient nevertheless.
Hi,

Eighteen months later...

I'm putting the code through some more scenarios, and will provide a pull request once the code in my add-on says it is still working in Version 1809 (hopefully in the next few hours or so).

Thanks.

Resolving patch:
diff --git a/source/NVDAObjects/UIA/__init__.py b/source/NVDAObjects/UIA/__init__.py
--- a/source/NVDAObjects/UIA/__init__.py
+++ b/source/NVDAObjects/UIA/__init__.py
@@ -30,7 +30,6 @@
 from NVDAObjects import NVDAObjectTextInfo, InvalidNVDAObject
 from NVDAObjects.behaviors import ProgressBar, EditableTextWithoutAutoSelectDetection, Dialog, Notification, EditableTextWithSuggestions
 import braille
-import time
 from locationHelper import RectLTWH
 import ui
 
@@ -774,7 +773,7 @@ def findOverlayClasses(self,clsList):
 		elif self.windowClassName=="Windows.UI.Core.CoreWindow" and UIAControlType==UIAHandler.UIA_WindowControlTypeId and "ToastView" in self.UIAElement.cachedAutomationId: # Windows 10
 			clsList.append(Toast_win10)
 		elif self.UIAElement.cachedFrameworkID in ("InternetExplorer","MicrosoftEdge"):
-			import edge
+			from . import edge
 			if UIAClassName in ("Internet Explorer_Server","WebView") and self.role==controlTypes.ROLE_PANE:
 				clsList.append(edge.EdgeHTMLRootContainer)
 			elif (self.UIATextPattern and
@@ -789,7 +788,7 @@ def findOverlayClasses(self,clsList):
 				clsList.append(edge.EdgeNode)
 		elif self.role==controlTypes.ROLE_DOCUMENT and self.UIAElement.cachedAutomationId=="Microsoft.Windows.PDF.DocumentView":
 				# PDFs
-				import edge
+				from . import edge
 				clsList.append(edge.EdgeHTMLRoot)
 		if UIAControlType==UIAHandler.UIA_ProgressBarControlTypeId:
 			clsList.append(ProgressBar)
@@ -803,7 +802,10 @@ def findOverlayClasses(self,clsList):
 			clsList.append(SensitiveSlider) 
 		if UIAControlType==UIAHandler.UIA_TreeItemControlTypeId:
 			clsList.append(TreeviewItem)
-		elif UIAControlType==UIAHandler.UIA_ComboBoxControlTypeId:
+		# Some combo boxes and looping selectors do not expose value pattern.
+		elif (UIAControlType==UIAHandler.UIA_ComboBoxControlTypeId
+		# #5231: Announce values in time pickers by "transforming" them into combo box without value pattern objects.
+		or (UIAControlType==UIAHandler.UIA_ListControlTypeId and "LoopingSelector" in UIAClassName)):
 			try:
 				if not self._getUIACacheablePropertyValue(UIAHandler.UIA_IsValuePatternAvailablePropertyId):
 					clsList.append(ComboBoxWithoutValuePattern)


Test patch: