Skip to content

Commit

Permalink
LogonUI: Announce dialog content for Windows 10, allow password/pin b…
Browse files Browse the repository at this point in the history
…ox to be navigable using touch/object navigation. re #6010 #6024 (#6073)
  • Loading branch information
josephsl authored and michaelDCurran committed Jul 24, 2016
1 parent 9abe628 commit e3e83b2
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions source/appModules/logonui.py
Expand Up @@ -2,7 +2,7 @@
#A part of NonVisual Desktop Access (NVDA)
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
#Copyright (C) 2009-2011 James Teh <jamie@jantrid.net>, Michael Curran <mick@kulgan.net>
#Copyright (C) 2009-2016 NV Access Limited, Joseph Lee

import speech
import api
Expand Down Expand Up @@ -39,6 +39,7 @@ def event_gainFocus(self):
class Win8PasswordField(UIA):

#This UIA object has no invoke pattern, at least set focus.
# #6024: Affects both Windows 8.x and 10.
def doAction(self,index=None):
if not index:
self.setFocus()
Expand Down Expand Up @@ -82,9 +83,11 @@ def chooseNVDAObjectOverlayClasses(self, obj, clsList):
windowClass = obj.windowClassName

if UIAHandler.isUIAAvailable:
if isinstance(obj,UIA) and obj.UIAElement.cachedClassName=="TouchEditInner" and obj.role==controlTypes.ROLE_EDITABLETEXT:
if isinstance(obj,UIA) and obj.UIAElement.cachedClassName in ("TouchEditInner", "PasswordBox") and obj.role==controlTypes.ROLE_EDITABLETEXT:
clsList.insert(0,Win8PasswordField)
if windowClass == "AUTHUI.DLL: LogonUI Logon Window" and obj.parent and obj.parent.parent and not obj.parent.parent.parent:
# #6010: Allow Windows 10 version to be recognized as well.
if ((windowClass == "AUTHUI.DLL: LogonUI Logon Window" and obj.parent and obj.parent.parent and not obj.parent.parent.parent)
or (windowClass == "LogonUI Logon Window" and obj.UIAIsWindowElement)):
clsList.insert(0, LogonDialog)
return

Expand All @@ -95,9 +98,10 @@ def chooseNVDAObjectOverlayClasses(self, obj, clsList):
return

def event_gainFocus(self,obj,nextHandler):
if obj.windowClassName=="DirectUIHWND" and obj.role==controlTypes.ROLE_BUTTON and not obj.next:
# #6010: Windows 10 version uses a different window class name.
if obj.windowClassName in ("DirectUIHWND", "LogonUI Logon Window") and obj.role==controlTypes.ROLE_BUTTON and not obj.next:
prev=obj.previous
if prev and prev.role==controlTypes.ROLE_STATICTEXT:
if prev and prev.role in (controlTypes.ROLE_STATICTEXT, controlTypes.ROLE_PANE):
# This is for a popup message in the logon dialog.
# Present the dialog again so the message will be reported.
speech.speakObjectProperties(api.getForegroundObject(),name=True,role=True,description=True)
Expand Down

0 comments on commit e3e83b2

Please sign in to comment.