Ejemplo n.º 1
0
	def __init__(self):
		style = wx.DEFAULT_FRAME_STYLE ^ wx.MAXIMIZE_BOX ^ wx.MINIMIZE_BOX | wx.FRAME_NO_TASKBAR
		super(MainFrame, self).__init__(None, wx.ID_ANY, versionInfo.name, size=(1,1), style=style)
		self.Bind(wx.EVT_CLOSE, self.onExitCommand)
		self.sysTrayIcon = SysTrayIcon(self)
		#: The focus before the last popup or C{None} if unknown.
		#: This is only valid before L{prePopup} is called,
		#: so it should be used as early as possible in any popup that needs it.
		#: @type: L{NVDAObject}
		self.prevFocus = None
		#: The focus ancestors before the last popup or C{None} if unknown.
		#: @type: list of L{NVDAObject}
		self.prevFocusAncestors = None
		# If NVDA has the uiAccess privilege, it can always set the foreground window.
		import systemUtils
		if not systemUtils.hasUiAccess():
			# This makes Windows return to the previous foreground window and also seems to allow NVDA to be brought to the foreground.
			self.Show()
			self.Hide()
			if winUser.isWindowVisible(self.Handle):
				# HACK: Work around a wx bug where Hide() doesn't actually hide the window,
				# but IsShown() returns False and Hide() again doesn't fix it.
				# This seems to happen if the call takes too long.
				self.Show()
				self.Hide()
Ejemplo n.º 2
0
def isAudioDuckingSupported():
    global _isAudioDuckingSupported
    if _isAudioDuckingSupported is None:
        _isAudioDuckingSupported = (config.isInstalledCopy()
                                    or config.isAppX) and hasattr(
                                        oledll.oleacc,
                                        'AccSetRunningUtilityState')
        _isAudioDuckingSupported &= systemUtils.hasUiAccess()
    return _isAudioDuckingSupported
Ejemplo n.º 3
0
	def send_SAS(self, **kwargs):
		"""
		This function simulates as "a secure attention sequence" such as CTRL+ALT+DEL.
		SendSAS requires UI Access, so we provide a warning when this fails.
		This warning will only be read by the remote NVDA if it is currently connected to the machine.
		"""
		if hasUiAccess():
			ctypes.windll.sas.SendSAS(0)
		else:
			# Translators: Sent when a user fails to send CTRL+ALT+DEL from a remote NVDA instance
			ui.message(_("No permission on device to trigger CTRL+ALT+DEL from remote"))
			logger.warning("UI Access is disabled on this machine so cannot trigger CTRL+ALT+DEL")
Ejemplo n.º 4
0
def touchSupported(debugLog: bool = False):
    """Returns if the system and current NVDA session supports touchscreen interaction.
	@param debugLog: Whether to log additional details about touch support to the NVDA log.
	"""
    if not config.isInstalledCopy() and not config.isAppX:
        if debugLog:
            log.debugWarning("Touch only supported on installed copies")
        return False
    if winVersion.getWinVer() < winVersion.WIN8:
        if debugLog:
            log.debugWarning("Touch only supported on Windows 8 and higher")
        return False
    maxTouches = windll.user32.GetSystemMetrics(SM_MAXIMUMTOUCHES)
    if maxTouches <= 0:
        if debugLog:
            log.debugWarning("No touch devices found")
        return False
    if not systemUtils.hasUiAccess():
        if debugLog:
            log.debugWarning(
                "NVDA doesn't have UI Access so touch isn't supported.")
        return False
    return True
Ejemplo n.º 5
0
def hasUiAccess(*args, **kwargs):
    import systemUtils
    systemUtils.hasUiAccess(*args, **kwargs)