IAccessibleHandler package
- IAccessibleHandler.getStatesSetFromIAccessibleAttrs(attrs: textInfos.ControlField) Set[State]
- IAccessibleHandler.getStatesSetFromIAccessible2Attrs(attrs: textInfos.ControlField) Set[State]
- IAccessibleHandler.calculateNvdaRole(IARole: int, IAStates: int) Role
Convert IARole value into an NVDA role, and apply any required transformations.
- IAccessibleHandler.calculateNvdaStates(IARole: int, IAStates: int) Set[State]
Convert IAStates bit set into a Set of NVDA States and apply any required transformations.
- IAccessibleHandler.normalizeIAccessible(pacc: IUnknown | IAccessible | IAccessible2, childID: int = 0) IAccessible | IAccessible2
- IAccessibleHandler.accessibleObjectFromEvent(window, objectID, childID)
- IAccessibleHandler.accessibleObjectFromPoint(x, y)
- IAccessibleHandler.windowFromAccessibleObject(ia)
- IAccessibleHandler.accessibleChildren(ia, startIndex, numChildren)
- IAccessibleHandler.accFocus(ia)
- IAccessibleHandler.accHitTest(ia, x, y)
- IAccessibleHandler.accChild(ia, child)
- IAccessibleHandler.accParent(ia, child)
- IAccessibleHandler.winEventToNVDAEvent(eventID: int, window: int, objectID: int, childID: int, useCache: bool = True) Tuple[str, IAccessible] | None
- Tries to convert a win event ID to an NVDA event name, and instantiate or fetch an NVDAObject for
the win event parameters.
@param eventID: the win event ID (type) @param window: the win event’s window handle @param objectID: the win event’s object ID @param childID: the win event’s childID @param useCache: C{True} to use the L{liveNVDAObjectTable} cache when
retrieving an NVDAObject, C{False} if the cache should not be used.
@returns: the NVDA event name and the NVDAObject the event is for
- IAccessibleHandler.processGenericWinEvent(eventID, window, objectID, childID)
Converts the win event to an NVDA event, Checks to see if this NVDAObject equals the current focus. If all goes well, then the event is queued and we return True @param eventID: a win event ID (type) @type eventID: integer @param window: a win event’s window handle @type window: integer @param objectID: a win event’s object ID @type objectID: integer @param childID: a win event’s child ID @type childID: integer @returns: True if the event was processed, False otherwise. @rtype: boolean
- IAccessibleHandler.processFocusWinEvent(window, objectID, childID, force=False)
checks to see if the focus win event is not the same as the existing focus, then converts the win event to an NVDA event (instantiating an NVDA Object) then calls processFocusNVDAEvent. If all is ok it returns True. @type window: integer @param objectID: a win event’s object ID @type objectID: integer @param childID: a win event’s child ID @type childID: integer @param force: If True, the shouldAllowIAccessibleFocusEvent property of the object is ignored. @type force: boolean @returns: True if the focus is valid and was handled, False otherwise. @rtype: boolean
- IAccessibleHandler.processFocusNVDAEvent(obj, force=False)
Processes a focus NVDA event. If the focus event is valid, it is queued. @param obj: the NVDAObject the focus event is for @type obj: L{NVDAObjects.NVDAObject} @param force: If True, the shouldAllowIAccessibleFocusEvent property of the object is ignored. @type force: boolean @return: C{True} if the focus event is valid and was queued, C{False} otherwise. @rtype: boolean
- IAccessibleHandler.processDesktopSwitchWinEvent(window, objectID, childID)
- IAccessibleHandler._handleUserDesktop()
- IAccessibleHandler.processForegroundWinEvent(window, objectID, childID)
checks to see if the foreground win event is not the same as the existing focus or any of its parents, then converts the win event to an NVDA event (instantiating an NVDA Object) and then checks the NVDAObject against the existing focus object. If all is ok it queues the foreground event to NVDA and returns True. @param window: a win event’s window handle @type window: integer @param objectID: a win event’s object ID @type objectID: integer @param childID: a win event’s child ID @type childID: integer @returns: True if the foreground was processed, False otherwise. @rtype: boolean
- IAccessibleHandler.processShowWinEvent(window, objectID, childID)
- IAccessibleHandler.processDestroyWinEvent(window, objectID, childID)
Process a destroy win event. This removes the object associated with the event parameters from L{liveNVDAObjectTable} if such an object exists.
- IAccessibleHandler.processMenuStartWinEvent(eventID, window, objectID, childID, validFocus)
Process a menuStart win event. @postcondition: Focus will be directed to the menu if appropriate.
- IAccessibleHandler.processFakeFocusWinEvent(eventID, window, objectID, childID)
Process a fake focus win event. @postcondition: The focus will be found and an event generated for it if appropriate.
- IAccessibleHandler._fakeFocus(oldFocus)
- IAccessibleHandler.accPropServices = None
Only valid after initialisation.
- IAccessibleHandler.initialize()
- IAccessibleHandler.pumpAll()
- IAccessibleHandler.terminate()
- IAccessibleHandler.getIAccIdentity(pacc, childID)
- IAccessibleHandler.findGroupboxObject(obj)
- IAccessibleHandler.getRecursiveTextFromIAccessibleTextObject(obj, startOffset=0, endOffset=-1)
- IAccessibleHandler.splitIA2Attribs(attribsString: str) Dict[str, str | Dict]
Split an IAccessible2 attributes string into a dict of attribute keys and values. An invalid attributes string does not cause an error, but strange results may be returned. Subattributes are handled. Subattribute keys and values are placed into a dict which becomes the value of the attribute. @param attribsString: The IAccessible2 attributes string to convert. @return: A dict of the attribute keys and values, where values are strings or dicts.
- IAccessibleHandler.isMarshalledIAccessible(IAccessibleObject)
Looks at the location of the first function in the IAccessible object’s vtable (IUnknown::AddRef) to see if it was implemented in oleacc.dll (its local) or ole32.dll (its marshalled).
Submodules
IAccessibleHandler.internalWinEventHandler module
Provides a non-threaded (limited by GIL) Windows Event Hook and processing.
- IAccessibleHandler.internalWinEventHandler.winEventCallback(handle, eventID, window, objectID, childID, threadID, timestamp)
- IAccessibleHandler.internalWinEventHandler.initialize(processDestroyWinEventFunc: Callable[[c_long, c_long, c_long], None])
- IAccessibleHandler.internalWinEventHandler.terminate()
- IAccessibleHandler.internalWinEventHandler._shouldGetEvents()
IAccessibleHandler.orderedWinEventLimiter module
- class IAccessibleHandler.orderedWinEventLimiter.OrderedWinEventLimiter(maxFocusItems=4)
Bases:
object
Collects and limits winEvents based on whether they are focus changes, or just generic (all other ones).
Only allow a max of L{maxFocusItems}: - if more are added then the oldest focus event is removed to make room. Only allow one event for one specific object at a time: - though push it further forward in time if a duplicate tries to get added. - This is true for both generic and focus events.
@param maxFocusItems: the amount of focus changed events allowed to be queued. @type maxFocusItems: integer
- addEvent(eventID: int, window: int, objectID: int, childID: int, threadID: int) bool
Adds a winEvent to the limiter. @param eventID: the winEvent type @param window: the window handle of the winEvent @param objectID: the objectID of the winEvent @param childID: the childID of the winEvent @param threadID: the threadID of the winEvent @return: C{True} if the event was added, C{False} if it was discarded.
- flushEvents(alwaysAllowedObjects: List[Tuple[int, int, int]] | None = None) List
Returns a list of winEvents that have been added. Due to limiting, it will not necessarily be all the winEvents that were originally added. They are definitely guaranteed to be in the correct order though. winEvents for objects listed in alwaysAllowedObjects will always be emitted, Even if the winEvent limit for that thread has been exceeded. @return Tuple[eventID,window,objectID,childID]
IAccessibleHandler.types module
Types used in IAccessibleHander. Kept here so they can be re-used without having to worry about circular imports.
- class IAccessibleHandler.types.RelationType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
str
,Enum
- FLOWS_FROM = 'flowsFrom'
- FLOWS_TO = 'flowsTo'
- CONTAINING_DOCUMENT = 'containingDocument'
- DETAILS = 'details'
- DETAILS_FOR = 'detailsFor'
- CONTROLLER_FOR = 'controllerFor'
- ERROR = 'error'
- ERROR_FOR = 'errorFor'
- _generate_next_value_(start, count, last_values)
Generate the next value when not given.
name: the name of the member start: the initial start value or None count: the number of existing members last_values: the list of values assigned
- _new_member_(**kwargs)
Create and return a new object. See help(type) for accurate signature.
- _use_args_ = True
- _member_names_ = ['FLOWS_FROM', 'FLOWS_TO', 'CONTAINING_DOCUMENT', 'DETAILS', 'DETAILS_FOR', 'CONTROLLER_FOR', 'ERROR', 'ERROR_FOR']
- _member_map_ = {'CONTAINING_DOCUMENT': RelationType.CONTAINING_DOCUMENT, 'CONTROLLER_FOR': RelationType.CONTROLLER_FOR, 'DETAILS': RelationType.DETAILS, 'DETAILS_FOR': RelationType.DETAILS_FOR, 'ERROR': RelationType.ERROR, 'ERROR_FOR': RelationType.ERROR_FOR, 'FLOWS_FROM': RelationType.FLOWS_FROM, 'FLOWS_TO': RelationType.FLOWS_TO}
- _value2member_map_ = {'containingDocument': RelationType.CONTAINING_DOCUMENT, 'controllerFor': RelationType.CONTROLLER_FOR, 'details': RelationType.DETAILS, 'detailsFor': RelationType.DETAILS_FOR, 'error': RelationType.ERROR, 'errorFor': RelationType.ERROR_FOR, 'flowsFrom': RelationType.FLOWS_FROM, 'flowsTo': RelationType.FLOWS_TO}
- _unhashable_values_ = []
- _member_type_
alias of
str
- _value_repr_()
Return repr(self).
IAccessibleHandler.utils module
Utility functions for IAccessibleHander. Kept here so they can be re-used without having to worry about circular imports.
- IAccessibleHandler.utils.getWinEventName(eventID)
Looks up the name of an EVENT_* winEvent constant.
- IAccessibleHandler.utils.getObjectIDName(objectID)
Looks up the name of an OBJID_* winEvent constant.
- IAccessibleHandler.utils.getWinEventLogInfo(window, objectID, childID, eventID=None, threadID=None)
Formats the given winEvent parameters into a printable string. window, objectID and childID are mandatory, but eventID and threadID are optional.
- IAccessibleHandler.utils.isMSAADebugLoggingEnabled()
Whether the user has configured NVDA to log extra information about MSAA events.