Re: Display label count
Posted: Tue Oct 28, 2014 10:07 pm
Hi Edgar, thanks for taking the time.
Your guesses are very close to the truth.
(NVDA uses Python as script language, JAWS has a proprietary script language that is similar)
I can get the object with focus very simple (from a script or the python console):
and from there you can simply type
to get e.g. u'Edit' for an edit field.
The predefined methods and attributes can be got with dir(obj):
(sorry, the lines are not properly wrapped, it is just for illustration)
NVDA (my screen reader) translates objects to some kind of base objects. Thus, a Java button will be the same as a WXWidgets button.
However, the control types can be rearranged anyway we like either by defining new classes or by modifying single properties from a class.
If a text is assigned to 'Description', a keybinding can be created and the text spoken.
It is clear that an additional Audacity module has to be created to make the additional features available.
For instance:
The currently shipped Audacity module is very simple: it just removes '&' in e.g. menus and buttons. There's a lot of space still available...
Your guesses are very close to the truth.
(NVDA uses Python as script language, JAWS has a proprietary script language that is similar)
I can get the object with focus very simple (from a script or the python console):
Code: Select all
FocusObject = api.getFocusObject()Code: Select all
focusObject.windowClassNameThe predefined methods and attributes can be got with dir(obj):
Code: Select all
>>> dir(focus)
['APIClass', 'IA2Attributes', 'IA2UniqueID', 'IAccessibleChildID', 'IAccessibleIdentity', 'IAccessibleObject', 'IAccessibleRole', 'IAccessibleStates', 'IAccessibleTableUsesTableCellIndexAttrib', 'IID_ITextServices', 'SLEEP_FULL', 'TextInfo', '_AutoPropertyObject__instances', '_IA2Relations', '_IATableCell', '_IAccessibleIdentity', '__class__', '__delattr__', '__dict__', '__doc__', '__eq__', '__format__', '__getattribute__', '__hash__', '__init__', '__metaclass__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_appModuleRef', '_cache_role', '_cache_sleepMode', '_findSimpleNext', '_formatLongDevInfoString', '_gestureMap', '_getIA2RelationFirstTarget', '_getPropertyViaCache', '_get_IA2Attributes', '_get_IAccessibleIdentity', '_get_IAccessibleRole', '_get_IAccessibleStates', '_get_TextInfo', '_get__IA2Relations', '_get__IATableCell', '_get_actionCount', '_get_activeChild', '_get_allowIAccessibleChildIDAndChildCountForPositionInfo', '_get_appModule', '_get_basicText', '_get_cellCoordsText', '_get_childCount', '_get_children', '_get_columnCount', '_get_columnHeaderText', '_get_columnNumber', '_get_container', '_get_decodedAccDescription', '_get_defaultActionIndex', '_get_description', '_get_devInfo', '_get_displayText', '_get_embeddingTextInfo', '_get_firstChild', '_get_flatReviewPosition', '_get_flowsFrom', '_get_flowsTo', '_get_groupName', '_get_hasFocus', '_get_indexInParent', '_get_isFocusable', '_get_isInForeground', '_get_isPresentableFocusAncestor', '_get_isProtected', '_get_isWindowUnicode', '_get_keyboardShortcut', '_get_labeledBy', '_get_lastChild', '_get_location', '_get_locationText', '_get_name', '_get_next', '_get_parent', '_get_positionInfo', '_get_presentationType', '_get_previous', '_get_processHandle', '_get_processID', '_get_recursiveDescendants', '_get_role', '_get_rowCount', '_get_rowHeaderText', '_get_rowNumber', '_get_shouldAllowIAccessibleFocusEvent', '_get_simpleFirstChild', '_get_simpleLastChild', '_get_simpleNext', '_get_simpleParent', '_get_simplePrevious', '_get_sleepMode', '_get_states', '_get_statusBar', '_get_table', '_get_tableID', '_get_treeInterceptor', '_get_treeInterceptorClass', '_get_value', '_get_windowClassName', '_get_windowControlID', '_get_windowStyle', '_get_windowText', '_get_windowThreadID', '_isEqual', '_mouseEntered', '_processIDThreadID', '_propertyCache', '_set_treeInterceptor', '_speakObjectPropertiesCache', '_tableHeaderTextHelper', '_treeInterceptor', '_windowClassName', 'actionCount', 'activeChild', 'allowIAccessibleChildIDAndChildCountForPositionInfo', 'appModule', 'basicText', 'beTransparentToMouse', 'bindGesture', 'bindGestures', 'cachePropertiesByDefault', 'cellCoordsText', 'childCount', 'children', 'clearGestureBindings', 'columnCount', 'columnHeaderText', 'columnNumber', 'container', 'correctAPIForRelation', 'decodedAccDescription', 'defaultActionIndex', 'description', 'devInfo', 'displayText', 'doAction', 'embeddingTextInfo', 'event_IA2AttributeChange', 'event_alert', 'event_becomeNavigatorObject', 'event_caret', 'event_childID', 'event_descriptionChange', 'event_focusEntered', 'event_foreground', 'event_gainFocus', 'event_mouseMove', 'event_nameChange', 'event_objectID', 'event_selection', 'event_selectionAdd', 'event_selectionRemove', 'event_selectionWithIn', 'event_stateChange', 'event_typedCharacter', 'event_valueChange', 'event_windowHandle', 'findBestAPIClass', 'findOverlayClasses', 'firstChild', 'flatReviewPosition', 'flowsFrom', 'flowsTo', 'focusRedirect', 'getActionName', 'getChild', 'getPossibleAPIClasses', 'getScript', 'groupName', 'hasEncodedAccDescription', 'hasFocus', 'indexInParent', 'invalidateCache', 'invalidateCaches', 'isDuplicateIAccessibleEvent', 'isFocusable', 'isInForeground', 'isPointInObject', 'isPresentableFocusAncestor', 'isProtected', 'isWindowUnicode', 'keyboardShortcut', 'kwargsFromSuper', 'labeledBy', 'lastChild', 'location', 'locationText', 'makeTextInfo', 'name', 'next', 'normalizeWindowClassName', 'normalizedWindowClassNameCache', 'objectFromPoint', 'objectInForeground', 'objectWithFocus', 'parent', 'positionInfo', 'presType_content', 'presType_layout', 'presType_unavailable', 'presentationType', 'previous', 'processHandle', 'processID', 're_positionInfoEncodedAccDescription', 'recursiveDescendants', 'redraw', 'removeGestureBinding', 'reportFocus', 'role', 'rowCount', 'rowHeaderText', 'rowNumber', 'scrollIntoView', 'setFocus', 'shouldAllowIAccessibleFocusEvent', 'shouldCreateTreeInterceptor', 'simpleFirstChild', 'simpleLastChild', 'simpleNext', 'simpleParent', 'simplePrevious', 'sleepMode', 'states', 'statusBar', 'table', 'tableID', 'textRepresentationLineLength', 'treeInterceptor', 'treeInterceptorClass', 'value', 'windowClassName', 'windowControlID', 'windowHandle', 'windowStyle', 'windowText', 'windowThreadID']NVDA (my screen reader) translates objects to some kind of base objects. Thus, a Java button will be the same as a WXWidgets button.
However, the control types can be rearranged anyway we like either by defining new classes or by modifying single properties from a class.
If a text is assigned to 'Description', a keybinding can be created and the text spoken.
It is clear that an additional Audacity module has to be created to make the additional features available.
For instance:
Code: Select all
# Audacity App Module for NVDA
import appModuleHandler
import api
import ui
class AppModule(appModuleHandler.AppModule):
def script_announceWindowClassName(self, gesture):
focusObj = api.getFocusQqqqqqqObject()
name = focusObj.name
windowClassName = focusObj.windowClassName
ui.message("class for %s window: %s" % (name, windowClassName))
def script_announceWindowControlID(self, gesture):
focusObj = api.getFocusObject()
name = focusObj.name
windowControlID = focusObj.windowControlID
ui.message("Control ID for %s window: %d" % (name, windowControlID))
__gestures = {
"kb:NVDA+leftArrow": "announceWindowClassName",
"kb:NVDA+rightArrow": "announceWindowControlID",
}