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)
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)
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)
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()
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)
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)
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()
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)
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)
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()
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()
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()
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)
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)
def script_pushToFront(self, gesture): if not self.focusDialog(): if self.anchoredPlaylist: api.setNavigatorObject(self.anchoredPlaylist) api.moveMouseToNVDAObject(self.anchoredPlaylist) self.mouseClick()
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)
def _get_name(self): api.moveMouseToNVDAObject(self) return super(mirandaIMButton,self)._get_name()
def script_contextMenu(self, gesture): api.moveMouseToNVDAObject(self) api.setMouseObject(self) mouseHandler.doSecondaryClick()
def _get_name(self): api.moveMouseToNVDAObject(self) return super(mirandaIMButton, self)._get_name()
def script_enter(self, gesture): api.moveMouseToNVDAObject(self) api.setMouseObject(self) mouseHandler.doPrimaryClick() mouseHandler.doPrimaryClick()