Exemplo n.º 1
0
	def script_enter(self, gesture):
		api.moveMouseToNVDAObject(self)
		api.setMouseObject(self)
		mouseHandler.executeMouseEvent(winUser.MOUSEEVENTF_LEFTDOWN,0,0)
		mouseHandler.executeMouseEvent(winUser.MOUSEEVENTF_LEFTUP,0,0)
		mouseHandler.executeMouseEvent(winUser.MOUSEEVENTF_LEFTDOWN,0,0)
		mouseHandler.executeMouseEvent(winUser.MOUSEEVENTF_LEFTUP,0,0)
Exemplo n.º 2
0
	def script_enter(self, gesture):
		api.moveMouseToNVDAObject(self)
		api.setMouseObject(self)
		winUser.mouse_event(winUser.MOUSEEVENTF_LEFTDOWN,0,0,None,None)
		winUser.mouse_event(winUser.MOUSEEVENTF_LEFTUP,0,0,None,None)
		winUser.mouse_event(winUser.MOUSEEVENTF_LEFTDOWN,0,0,None,None)
		winUser.mouse_event(winUser.MOUSEEVENTF_LEFTUP,0,0,None,None)
Exemplo n.º 3
0
	def script_toolBar(self, gesture):
		obj = self.getToolBar()
		if obj is not None:
			if obj != api.getMouseObject():
				api.moveMouseToNVDAObject(obj)
				api.setMouseObject(obj)
			if controlTypes.STATE_FOCUSED not in obj.states:
				obj.setFocus()
			eventHandler.queueEvent("gainFocus", obj)
Exemplo n.º 4
0
	def script_list(self, gesture):
		try:
			obj = NVDAObjects.IAccessible.getNVDAObjectFromEvent(
				windowUtils.findDescendantWindow(
					api.getForegroundObject().windowHandle, visible=True, className="SysListView32"
				), winUser.OBJID_CLIENT, 0
			)
		except LookupError:
			return
		if obj != api.getFocusObject():
			api.moveMouseToNVDAObject(obj)
			api.setMouseObject(obj)
			mouseHandler.doPrimaryClick()
Exemplo n.º 5
0
 def script_pressButton(self, gesture):
     if self.pointedObj:
         if controlTypes.STATE_PRESSED in self.pointedObj.states:
             #TRANSLATORS: a button has been unchecked
             ui.message(_("uncheck"))
         else:
             #TRANSLATORS: a button has been checked
             ui.message(_("check"))
         ui.message(self.pointedObj.name)
         api.moveMouseToNVDAObject(self.pointedObj)
         api.setMouseObject(self.pointedObj)
         winUser.mouse_event(winUser.MOUSEEVENTF_LEFTDOWN, 0, 0, None, None)
         winUser.mouse_event(winUser.MOUSEEVENTF_LEFTUP, 0, 0, None, None)
Exemplo n.º 6
0
	def script_name(self, gesture):
		try:
			obj = NVDAObjects.IAccessible.getNVDAObjectFromEvent(
				windowUtils.findDescendantWindow(
					api.getForegroundObject().windowHandle, visible=True, controlID=2183
				), winUser.OBJID_CLIENT, 0
			)
		except LookupError:
			return
		if obj != api.getFocusObject():
			api.moveMouseToNVDAObject(obj)
			api.setMouseObject(obj)
			winUser.mouse_event(winUser.MOUSEEVENTF_LEFTDOWN, 0, 0, None, None)
			winUser.mouse_event(winUser.MOUSEEVENTF_LEFTUP, 0, 0, None, None)
Exemplo n.º 7
0
	def script_doAction(self, gesture):
		# code written by Javi Dominguez and adapted to this add-on
		printDebug("script_doAction")
		obj = api.getNavigatorObject()
		mainWindow = self.appModule.mainWindow
		anchoredPlaylist = mainWindow.mainPanel.anchoredPlaylist
		oldAnchoredPlaylistState = anchoredPlaylist.isVisible()
		controlPanel = mainWindow.mainPanel.controlPanel
		if obj not in controlPanel.controls[1:]:
			gesture.send()
			return
		description = obj.description
		if obj.role not in [controlTypes.ROLE_BUTTON, controlTypes.ROLE_GRAPHIC]:
			obj.doAction()
			msg = []
			for state in obj.states:
				msg.append(controlTypes.stateLabels[state])
			desc = api.getMouseObject().description
			if obj.role == controlTypes.ROLE_CHECKBOX and\
				controlTypes.STATE_CHECKED not in obj.states:
				msg.append(_("unchecked"))
				if desc:
					msg.append(api.getMouseObject().description)
			elif desc and description == desc:
				msg.append(desc)
			if len(msg):
				text = ", ".join(msg)
				ui.message(text)
		else:
			api.moveMouseToNVDAObject(obj)
			x, y = winUser.getCursorPos()
			o = api.getDesktopObject().objectFromPoint(x, y) 
			if o.description == obj.description:
				controlPanel.clickButton(obj)
				api.processPendingEvents()
				api.moveMouseToNVDAObject(obj)
				o = api.getDesktopObject().objectFromPoint(x, y)
				if description != o.description:
					ui.message(api.getMouseObject().description)
			else:
				pass
		newAnchoredPlaylistState = anchoredPlaylist.isVisible()
		if not oldAnchoredPlaylistState and newAnchoredPlaylistState:
			obj = anchoredPlaylist.NVDAObject
			mouseClick(obj)
			return
		# put focus on new dialog if there is one (like adjustments and effects)
		self.focusDialog()
Exemplo n.º 8
0
 def selectItem(self, item):
     if item and item.role == controlTypes.Role.LISTITEM:
         item.scrollIntoView()
         api.setNavigatorObject(item)
         api.moveMouseToNVDAObject(item)
         x, y = winUser.getCursorPos()
         if api.getDesktopObject().objectFromPoint(x, y) == item:
             winUser.mouse_event(winUser.MOUSEEVENTF_LEFTDOWN, 0, 0, None,
                                 None)
             winUser.mouse_event(winUser.MOUSEEVENTF_LEFTUP, 0, 0, None,
                                 None)
             item.setFocus()
             api.setFocusObject(item)
             if item.name: ui.message(item.name)
         else:
             tones.beep(200, 20)
Exemplo n.º 9
0
	def script_searchList(self, gesture):
		where = self.getWhere()
		if not hasattr(where, "IAccessibleChildID") or where.IAccessibleChildID != 6:
			return
		try:
			obj = NVDAObjects.IAccessible.getNVDAObjectFromEvent(
				windowUtils.findDescendantWindow(
					api.getForegroundObject().windowHandle, controlID=2833
				), winUser.OBJID_CLIENT, 0
			)
		except LookupError:
			return
		if obj != api.getFocusObject():
			api.moveMouseToNVDAObject(obj)
			api.setMouseObject(obj)
			mouseHandler.doPrimaryClick()
def mouseClick(obj, rightButton=False, twice=False):
	api.moveMouseToNVDAObject(obj)
	api.setMouseObject(obj)
	if not rightButton:
		winUser.mouse_event(winUser.MOUSEEVENTF_LEFTDOWN, 0, 0, None, None)
		winUser.mouse_event(winUser.MOUSEEVENTF_LEFTUP, 0, 0, None, None)
		if twice:
			time.sleep(0.1)
			winUser.mouse_event(winUser.MOUSEEVENTF_LEFTDOWN, 0, 0, None, None)
			winUser.mouse_event(winUser.MOUSEEVENTF_LEFTUP, 0, 0, None, None)
	else:
		winUser.mouse_event(winUser.MOUSEEVENTF_RIGHTDOWN, 0, 0, None, None)
		winUser.mouse_event(winUser.MOUSEEVENTF_RIGHTUP, 0, 0, None, None)
		if twice:
			time.sleep(0.1)
			winUser.mouse_event(winUser.MOUSEEVENTF_RIGHTDOWN, 0, 0, None, None)
			winUser.mouse_event(winUser.MOUSEEVENTF_RIGHTUP, 0, 0, None, None)
	def selectItem(self, item):
		if item:
			item.scrollIntoView()
			api.setNavigatorObject(item)
			api.moveMouseToNVDAObject(item)
			x, y = winUser.getCursorPos()
			if api.getDesktopObject().objectFromPoint(x, y) == item:
				winUser.mouse_event(winUser.MOUSEEVENTF_LEFTDOWN, 0, 0, None, None)
				winUser.mouse_event(winUser.MOUSEEVENTF_LEFTUP, 0, 0, None, None)
				time.sleep(0.1)
				eventHandler.queueEvent("gainFocus", item)
				return
				item.setFocus()
				api.setFocusObject(item)
				if item.name:
					ui.message(item.name)
			else:
				pass
    def script_TCAvolu(self, gesture):
        fg = api.getForegroundObject()
        obj = fg.children[5].children[2].children[0].children[7]
        ui.message("el nombre es: {}".format(obj.name))

        api.moveMouseToNVDAObject(obj)
        keyboardHandler.KeyboardInputGesture.fromName("space").send()

        os.chdir(tsu.a_path)
        focus = api.getFocusObject()
        focus = focus.parent
        a = '''Red
Acceso a Internet'''
        if focus.name == a:
            recButton = focus.parent.next.firstChild
            api.moveMouseToNVDAObject(recButton)
            winUser.mouse_event(winUser.MOUSEEVENTF_LEFTDOWN, 0, 0, None, None)
            winUser.mouse_event(winUser.MOUSEEVENTF_LEFTUP, 0, 0, None, None)
Exemplo n.º 13
0
	def script_readOnlyEdit(self, gesture):
		where = self.getWhere()
		if hasattr(where, "IAccessibleChildID") and where.IAccessibleChildID == 9:
			cID = -1
		else:
			cID = None
		try:
			obj = NVDAObjects.IAccessible.getNVDAObjectFromEvent(
				windowUtils.findDescendantWindow(
					api.getForegroundObject().windowHandle, visible=True, className="RichEdit20W", controlID=cID
				), winUser.OBJID_CLIENT, 0
			)
		except LookupError:
			return
		if obj != api.getFocusObject():
			api.moveMouseToNVDAObject(obj)
			api.setMouseObject(obj)
			mouseHandler.doPrimaryClick()
Exemplo n.º 14
0
 def script_doAction(self, gesture):
     obj = api.getNavigatorObject()
     if obj not in self.playbackControls:
         gesture.send()
         return
     try:
         obj.doAction()
         for state in obj.states:
             ui.message(controlTypes.stateLabels[state])
         if obj.role == controlTypes.Role.CHECKBOX and controlTypes.State.CHECKED not in obj.states:
             ui.message(_("unchecked"))
     except:
         api.moveMouseToNVDAObject(obj)
         x, y = winUser.getCursorPos()
         if api.getDesktopObject().objectFromPoint(x, y) == obj:
             self.mouseClick()
         else:
             tones.beep(200, 50)
     self.focusDialog()
Exemplo n.º 15
0
 def script_attachments(self, gesture):
     doc = self.isDocument()
     if doc and controlTypes.STATE_READONLY in doc.states:
         try:
             attachmentToggleButton = filter(
                 lambda o: o.IA2Attributes["id"] == "attachmentToggle",
                 self.getPropertyPage().children)[0]
         except IndexError:
             #TRANSLATORS: there are no attachments in this message
             ui.message(_("There are No attachments"))
             return
         ui.message(attachmentToggleButton.next.name)
         if controlTypes.STATE_PRESSED not in attachmentToggleButton.states:
             api.moveMouseToNVDAObject(attachmentToggleButton)
             winUser.mouse_event(winUser.MOUSEEVENTF_LEFTDOWN, 0, 0, None,
                                 None)
             winUser.mouse_event(winUser.MOUSEEVENTF_LEFTUP, 0, 0, None,
                                 None)
         else:
             self.getPropertyPage().children[-1].getChild(0).setFocus()
         return
     gesture.send()
Exemplo n.º 16
0
	def script_contextMenu(self, gesture):
		api.moveMouseToNVDAObject(self)
		api.setMouseObject(self)
		winUser.mouse_event(winUser.MOUSEEVENTF_RIGHTDOWN,0,0,None,None)
		winUser.mouse_event(winUser.MOUSEEVENTF_RIGHTUP,0,0,None,None)
Exemplo n.º 17
0
	def script_contextMenu(self, gesture):
		api.moveMouseToNVDAObject(self)
		api.setMouseObject(self)
		mouseHandler.executeMouseEvent(winUser.MOUSEEVENTF_RIGHTDOWN,0,0)
		mouseHandler.executeMouseEvent(winUser.MOUSEEVENTF_RIGHTUP,0,0)
Exemplo n.º 18
0
 def script_pushToFront(self, gesture):
     if not self.focusDialog():
         if self.anchoredPlaylist:
             api.setNavigatorObject(self.anchoredPlaylist)
             api.moveMouseToNVDAObject(self.anchoredPlaylist)
             self.mouseClick()
Exemplo n.º 19
0
 def script_contextMenu(self, gesture):
     api.moveMouseToNVDAObject(self)
     api.setMouseObject(self)
     mouseHandler.executeMouseEvent(winUser.MOUSEEVENTF_RIGHTDOWN, 0, 0)
     mouseHandler.executeMouseEvent(winUser.MOUSEEVENTF_RIGHTUP, 0, 0)
Exemplo n.º 20
0
	def _get_name(self):
		api.moveMouseToNVDAObject(self)
		return super(mirandaIMButton,self)._get_name()
Exemplo n.º 21
0
 def script_contextMenu(self, gesture):
     api.moveMouseToNVDAObject(self)
     api.setMouseObject(self)
     mouseHandler.doSecondaryClick()
Exemplo n.º 22
0
 def _get_name(self):
     api.moveMouseToNVDAObject(self)
     return super(mirandaIMButton, self)._get_name()
Exemplo n.º 23
0
 def script_enter(self, gesture):
     api.moveMouseToNVDAObject(self)
     api.setMouseObject(self)
     mouseHandler.doPrimaryClick()
     mouseHandler.doPrimaryClick()