AccessEngine :: AEScript :: EventScript :: Class EventScript
[hide private]
[frames] | no frames]

Class EventScript

source code

                     object --+        
                              |        
AEUserInterface.AEUserInterface --+    
                                  |    
                           AEScript --+
                                      |
                                     EventScript

The EventScript class expands the AEScript class with methods, which are ment as a framework for the possible events. When a script needs to respond to a certain event, it should implement the appropriate method.

Instance Methods [hide private]
 
registerEventTask(self, task_name, event_kind, focus=False, tier=False, background=False, all=False)
Registers a task as an event task.
source code
 
unregisterEventTask(self, task_name, event_kind, class_name=None, focus=False, tier=False, background=False, all=False)
Unregisters an event task.
source code
 
updateOnCaretChange(self, **kwargs)
Updates this EventScript in response to a consumed caret change event.
source code
boolean
onCaretChange(self, **kwargs)
Executes this EventScript in response to a caret change event.
source code
boolean
onCaretInserted(self, **kwargs)
Executes this EventScript in response to a caret insert event.
source code
boolean
onCaretMoved(self, **kwargs)
Executes this EventScript in response to a caret movement event.
source code
boolean
onCaretDeleted(self, **kwargs)
Executes this EventScript in response to a caret delete event.
source code
 
updateOnChildrenChange(self, **kwargs)
Updates this EventScript in response to a consumed children change event.
source code
boolean
onChildrenChange(self, **kwargs)
Executes this EventScript in response to a children change event.
source code
boolean
onChildAdded(self, **kwargs)
Executes this EventScript in response to a ChildrenChange-added event.
source code
boolean
onChildRemoved(self, **kwargs)
Executes this EventScript in response to a ChildrenChange-removed event.
source code
 
updateOnFocusChange(self, **kwargs)
Updates this EventScript in response to a consumed focus change event.
source code
boolean
onFocusChange(self, **kwargs)
Executes this EventScript in response to a focus change event.
source code
boolean
onFocusGained(self, **kwargs)
Executes this EventScript in response to a focus gained event.
source code
boolean
onFocusLost(self, **kwargs)
Executes this EventScript in response to a focus lost event.
source code
 
updateOnMouseChange(self, **kwargs)
Updates this EventScript in response to a consumed mouse event.
source code
boolean
onMouseChange(self, **kwargs)
Executes this EventScript in response to a mouse event.
source code
boolean
onMouseMoved(self, **kwargs)
Executes this EventScript in response to a mouse movement.
source code
boolean
onMousePressed(self, **kwargs)
Executes this EventScript in response to a mouse button press.
source code
boolean
onMouseReleased(self, **kwargs)
Executes this EventScript in response to a mouse button release.
source code
 
updateOnPropertyChange(self, **kwargs)
Updates this EventScript in response to a consumed property change event.
source code
boolean
onPropertyChange(self, **kwargs)
Executes this EventScript in response to a property change event.
source code
 
updateOnScreenChange(self, **kwargs)
Updates this EventScript in response to a consumed screen change event.
source code
boolean
onScreenChange(self, **kwargs)
Executes this EventScript in response to a screen change event.
source code
boolean
onScreenResized(self, **kwargs)
Executes this EventScript in response to a change in the bounds of an object.
source code
boolean
onScreenReflowed(self, **kwargs)
Executes this EventScript in response to a change in the bounds of a body of text.
source code
boolean
onScreenRefreshed(self, **kwargs)
Executes this EventScript in response to a change in the visible data on an object.
source code
 
updateOnSelectorChange(self, **kwargs)
Update this EventScript in response to a consumed selector change event.
source code
boolean
onSelectorChange(self, **kwargs)
Executes this EventScript in response to a selector change event.
source code
boolean
onSelectorActive(self, **kwargs)
Executes this EventScript in response to an active selection change event.
source code
boolean
onSelectorText(self, **kwargs)
Executes this EventScript in response to an addition to the current selection.
source code
boolean
onSelectorAdded(self, **kwargs)
Executes this EventScript in response to a removal from the current selection.
source code
boolean
onSelectorRemoved(self, **kwargs)
Executes this EventScript in response to a removal from the current selection.
source code
 
updateOnStateChange(self, **kwargs)
Updates this EventScript in response to a consumed state change event.
source code
boolean
onStateChange(self, **kwargs)
Executes this EventScript in response to a state change event.
source code
 
updateOnTableChange(self, **kwargs)
Updates this EventScript in response to a consumed table change event.
source code
boolean
onTableChange(self, **kwargs)
Executes this EventScript in response to a hierarchy change event.
source code
boolean
onTableRowInserted(self, **kwargs)
Executes this EventScript in response to a row-inserted table change event.
source code
boolean
onTableRowDeleted(self, **kwargs)
Executes this EventScript in response to a row-deleted table change event.
source code
boolean
onTableRowReordered(self, **kwargs)
Executes this EventScript in response to a row-reordered table change event.
source code
boolean
onTableColumnInserted(self, **kwargs)
Executes this EventScript in response to a column-inserted table change event.
source code
boolean
onTableColumnDeleted(self, **kwargs)
Executes this EventScript in response to a column-deleted table change event.
source code
boolean
onTableColumnReordered(self, **kwargs)
Executes this EventScript in response to a column-reordered table change event.
source code
 
updateOnViewChange(self, **kwargs)
Updates this EventScript in response to a consumed view change event.
source code
boolean
onViewChange(self, **kwargs)
Executes this EventScript in response to a view change event.
source code
boolean
onViewGained(self, **kwargs)
Executes this EventScript in response to a view gained event.
source code
boolean
onViewLost(self, **kwargs)
Executes this EventScript in response to a view lost event.
source code
boolean
onViewStartup(self, **kwargs)
Executes this EventScript in response to the view being identified during SUE startup.
source code
boolean
onViewFirstGained(self, **kwargs)
Executes this EventScript in response to the view being identified as the active view during SUE startup.
source code
boolean
onChooserChange(self, **kwargs)
Executes a registered task function in response to some change in a AEChooser, starting it, ending it, or applying its current options.
source code
boolean
onChooserStart(self, **kwargs)
Executes a registered task function to start a new AEChooser, typically in response to input on an AEInput device.
source code
boolean
onChooserSignal(self, **kwargs)
Executes a registered task function in response to a chooser request to have its current options immediately applied without its completion.
source code
boolean
onChooserEnd(self, **kwargs)
Executes a registered task function in response to the ending of a chooser dialog.
source code
 
chainNewEventTaskAround(self, new_task, old_task, old_task_script=None, *functions_to_replace)
Allows to only replace certain parts of another event task.
source code
 
updateAroundTask(self, **kwargs)
Needed in context to chainNewEventTaskAround for the decision which update function should be executed.
source code
 
executeAroundTask(self, **kwargs)
Needed in context to chainNewEventTaskAround for the decision which execute function should be called.
source code
 
_doReplacedTask(self, **kwargs)
Needed in context with chainNewEventTaskAround.
source code

Inherited from AEScript: __init__, bindToEvent, chainTask, close, doCyclicInputTask, doTask, getAETier, getAnchorScriptClassName, getAnchorTaskId, getChainSegment, getChooserTask, getCommandTask, getEventTasks, getIdealOutput, getLastKey, getOutputDevices, getPointerPOR, getRegisteredTask, getScriptSetting, getScriptSettingVal, getState, getTaskKeys, getTempData, getVirtualPOR, init, mergeChain, postClose, preInit, registerChooserTask, registerCommand, registerCyclicInputTask, registerCyclicInputTasks, registerModifiers, registerTask, registerTimerTask, setIdealOutput, setPointerPOR, setScriptSettingVal, setTempData, setVirtualPOR, unbindFromEvent, unchainTask, unregisterChooserTask, unregisterCommand, unregisterCyclicInputTask, unregisterModifiers, unregisterTask, unregisterTaskFromCyclicInputTask, unregisterTimerTask

Inherited from AEScript (private): _changeDefaultOutput

Inherited from AEUserInterface.AEUserInterface: getClassName, getDescription, getName, getPath

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables [hide private]

Inherited from AEScript: STATE

Instance Variables [hide private]

Inherited from AEScript: after_chains, around_chains, around_tasks, before_chains, chooser_tasks, command_descriptions, commands, cyclic_input_tasks, def_out, event_tasks, out_caps, registered_modifiers, registered_tasks, state, tier

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

registerEventTask(self, task_name, event_kind, focus=False, tier=False, background=False, all=False)

source code 
Registers a task as an event task.
Parameters:
  • task_name (string) - Register the name of task.
  • event_kind (int) - For which event will this task be registered. Use the constants in AEConstants.Event that start with EVENT_TYPE_ to specify the event kind.
  • focus (boolean) - Should this task handle events from focused accessibles in this AETier?
  • tier (boolean) - Should this task handle events from unfocused accessibles in this AETier?
  • background (boolean) - Should this task handle events from any accessible in this AETier when the AETier is inactive?
  • all (boolean) - This task registers for all layers

Note:

This method calls the registerTask and bindToEvent methods.

The type determines which kind of AEEvent will trigger the execution of the registered task. If one or more tasks are already registered for this type, the given task will be inserted at the top of the registered stack of tasks (i.e. it will be executed first for the appropriate event).

The focus, tier, and background parameters specify on which layer the task will handle events. If focus is True, the task will be executed in response to an event from a focused control within this AETier. If tier is True, the task will be executed in response to an event from an unfocused control within this AETier. If background is True, the task will be executed in response to an event from any control within the tier when the AETier is not active.

The three layers are mutually exclusive. You may set any combination of focus, tier, and background to True to register the given task on each selected layer in one call. If all three parameters are False, the registration defaults to the focus layer.

unregisterEventTask(self, task_name, event_kind, class_name=None, focus=False, tier=False, background=False, all=False)

source code 
Unregisters an event task.
Parameters:
  • task_name (string) - Name of the task.
  • event_kind (int) - For which event was this task registered. Use the constants in AEConstants.Event that start with EVENT_TYPE_ to specify the event kind.
  • class_name (script) - Name of the script the task is implemented in. If class_name is None this script will be used as class_name.
  • focus (boolean) - Should this task handle events from focused accessibles in this AETier?
  • tier (boolean) - Should this task handle events from unfocused accessibles in this AETier?
  • background (boolean) - Should this task handle events from any accessible in this AETier when the AETier is inactive?
  • all (boolean) - This task registers for all layers.
Raises:
  • KeyError - When a task with the given name in the given script is not registered
  • KeyError - When there are no tasks registered for the event type on the specified layer
  • ValueError - When the given task is not registered for the event type on one of the specified layers

Note: calls the unbindFromEvent and unregisterTask methods.

updateOnCaretChange(self, **kwargs)

source code 

Updates this EventScript in response to a consumed caret change event. Called by AETier._executeTask.

This method should be implemented if it's needed.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • text (string) - The text inserted, deleted or the line of the caret
  • text_offset (integer) - The offset of the inserted/deleted text or the absolute offset when movement only
  • added (boolean) - True when text added, False when text deleted, and None (the default) when event is for caret movement only

onCaretChange(self, **kwargs)

source code 
Executes this EventScript in response to a caret change event. Called by AETier._executeTask.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • text (string) - The text inserted, deleted or the line of the caret
  • text_offset (integer) - The offset of the inserted/deleted text or the absolute offset when movement only
  • added (boolean) - True when text added, False when text deleted, and None (the default) when event is for caret movement only
Returns: boolean
True to allow other task to process this event

onCaretInserted(self, **kwargs)

source code 
Executes this EventScript in response to a caret insert event. Called by onCaretChange.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible
  • layer (integer) - Layer on which the event occurred
  • task_name (string) - Name of the task this function executes.
  • text (string) - The text inserted.
  • text_offset (integer) - The offset of the inserted text
  • added (boolean) - True when text added
Returns: boolean
True to allow other tasks to process this event

onCaretMoved(self, **kwargs)

source code 
Executes this EventScript in response to a caret movement event. Called by onCaretChange.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • text (string) - The text line of the caret.
  • text_offset (integer) - The absolute offset
  • added (boolean) - None (the default) when event is for caret movement
Returns: boolean
True to allow other tasks to process this event

onCaretDeleted(self, **kwargs)

source code 
Executes this EventScript in response to a caret delete event. Called by onCaretChange.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • text (string) - The text deleted or the line of the caret.
  • text_offset (integer) - The offset of the deleted text.
  • added (boolean) - False when text deleted.
Returns: boolean
True to allow other tasks to process this event

updateOnChildrenChange(self, **kwargs)

source code 
Updates this EventScript in response to a consumed children change event. Called by AETier._executeTask.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • added (boolean) - True when a child is added, False when removed.
  • child_por (AEPor) - The AEPor of added/removed child.

onChildrenChange(self, **kwargs)

source code 
Executes this EventScript in response to a children change event. Called by AETier._executeTask.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • added (boolean) - True when a child is added, False when removed.
  • child_por (AEPor) - The AEPor of added/removed child
Returns: boolean
True to allow other tasks to process this event

onChildAdded(self, **kwargs)

source code 
Executes this EventScript in response to a ChildrenChange-added event. Called by onChildrenChange.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • added (boolean) - True when a child is added
  • child_por (AEPor) - The AEPor of added child
Returns: boolean
True to allow other tasks to process this event

onChildRemoved(self, **kwargs)

source code 
Executes this EventScript in response to a ChildrenChange-removed event. Called by onChildrenChange.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • added (boolean) - False when a child removed.
  • child_por (AEPor) - The AEPor of added/removed child
Returns: boolean
True to allow other tasks to process this event

updateOnFocusChange(self, **kwargs)

source code 
Updates this EventScript in response to a consumed focus change event. Called by AETier._executeTask.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard related at which the event occurred
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • gained (boolean) - True when a focus gained or False when focus lost.

onFocusChange(self, **kwargs)

source code 
Executes this EventScript in response to a focus change event. Called by AETier._executeTask.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard related at which the event occurred.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • gained (boolean) - True when focus gained or False when focus lost.
Returns: boolean
True to allow other tasks to process this event

onFocusGained(self, **kwargs)

source code 
Executes this EventScript in response to a focus gained event. Called by onFocusChange.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard related at which the event occurred.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • gained (boolean) - True when focus gained.
Returns: boolean
True to allow other tasks to process this event

onFocusLost(self, **kwargs)

source code 
Executes this EventScript in response to a focus lost event. Called by onFocusChange.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard related at which the event occurred.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • gained (boolean) - False when focus lost.
Returns: boolean
True to allow other tasks to process this event

updateOnMouseChange(self, **kwargs)

source code 
Updates this EventScript in response to a consumed mouse event. Called by AETier._executeTask.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard related at which the event occurred.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • kind (integer) - Kind of event.
  • pos (2-tuple of integer) - Absolute position of the mouse pointer.
  • button (integer) - Number of the button pressed.

onMouseChange(self, **kwargs)

source code 
Executes this EventScript in response to a mouse event. Called by AETier._executeTask.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard related at which the event occurred.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • kind (integer) - Kind of event.
  • pos (2-tuple of integer) - Absolute position of the mouse pointer.
  • button (integer) - Number of the button pressed.
Returns: boolean
True to allow other tasks to process this event.

onMouseMoved(self, **kwargs)

source code 
Executes this EventScript in response to a mouse movement. Called by onMouseChange.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard related at which the event occurred.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • kind (integer) - Kind of event.
  • pos (2-tuple of integer) - Absolute position of the mouse pointer.
  • button (integer) - Number of the button pressed.
Returns: boolean
True to allow other tasks to process this event

onMousePressed(self, **kwargs)

source code 
Executes this EventScript in response to a mouse button press. Called by onMouseChange.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard related at which the event occurred.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • kind (integer) - Kind of event.
  • pos (2-tuple of integer) - Absolute position of the mouse pointer.
  • button (integer) - Number of the button pressed.
Returns: boolean
True to allow other tasks to process this event

onMouseReleased(self, **kwargs)

source code 
Executes this EventScript in response to a mouse button release. Called by onMouseChange.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard related at which the event occurred.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • kind (integer) - Kind of event.
  • pos (2-tuple of integer) - Absolute position of the mouse pointer.
  • button (integer) - Number of the button pressed.
Returns: boolean
True to allow other tasks to process this event.

updateOnPropertyChange(self, **kwargs)

source code 
Updates this EventScript in response to a consumed property change event. Called by AETier._executeTask.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • name (string) - Name of the property that changed.
  • value (string or number) - New value of the property.

onPropertyChange(self, **kwargs)

source code 
Executes this EventScript in response to a property change event. Called by AETier._executeTask.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • name (string) - Name of the property that changed.
  • value (string or number) - New value of the property.
Returns: boolean
True to allow other tasks to process this event

updateOnScreenChange(self, **kwargs)

source code 
Updates this EventScript in response to a consumed screen change event. Called by AETier._executeTask.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • kind (integer) - Indicates the kind of selection event.

onScreenChange(self, **kwargs)

source code 
Executes this EventScript in response to a screen change event. Called by AETier._executeTask.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • kind (integer) - Indicates the kind of selection event.
Returns: boolean
True to allow other tasks to process this event

onScreenResized(self, **kwargs)

source code 
Executes this EventScript in response to a change in the bounds of an object. Called by onScreenChange.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • kind (integer) - Indicates the kind of selection event.
Returns: boolean
True to allow other tasks to process this event.

onScreenReflowed(self, **kwargs)

source code 
Executes this EventScript in response to a change in the bounds of a body of text. Called by onScreenChange.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • kind (integer) - Indicates the kind of selection event.
Returns: boolean
True to allow other tasks to process this event.

onScreenRefreshed(self, **kwargs)

source code 
Executes this EventScript in response to a change in the visible data on an object. Called by onScreenChange.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • kind (integer) - Indicates the kind of selection event.
Returns: boolean
True to allow other tasks to process this event.

updateOnSelectorChange(self, **kwargs)

source code 
Update this EventScript in response to a consumed selector change event. Called by AETier._executeTask.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • kind (integer) - Indicates the kind of selection event.
  • text (string) - The accessible text or name of the item at the POR.

onSelectorChange(self, **kwargs)

source code 
Executes this EventScript in response to a selector change event. Called by AETier._executeTask.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • kind (integer) - Indicates the kind of selection event.
  • text (string) - The accessible text or name of the item at the POR.
Returns: boolean
Should processing continue? Always returns True by default.

onSelectorActive(self, **kwargs)

source code 
Executes this EventScript in response to an active selection change event. Called by onSelectorChange.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • kind (integer) - Indicates the kind of selection event.
  • text (string) - The accessible text or name of the item at the POR.
Returns: boolean
Should processing continue? Always returns True by default.

onSelectorText(self, **kwargs)

source code 
Executes this EventScript in response to an addition to the current selection. Called by onSelectorChange.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • kind (integer) - Indicates the kind of selection event.
  • text (string) - The accessible text or name of the item at the POR.
Returns: boolean
Should processing continue? Always returns True by default.

onSelectorAdded(self, **kwargs)

source code 
Executes this EventScript in response to a removal from the current selection. Called by onSelectorChange.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • kind (integer) - Indicates the kind of selection event.
  • text (string) - The accessible text or name of the item at the POR.
Returns: boolean
Should processing continue? Always returns True by default.

onSelectorRemoved(self, **kwargs)

source code 
Executes this EventScript in response to a removal from the current selection. Called by onSelectorChange.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • kind (integer) - Indicates the kind of selection event.
  • text (string) - The accessible text or name of the item at the POR.
Returns: boolean
Should processing continue? Always returns True by default.

updateOnStateChange(self, **kwargs)

source code 
Updates this EventScript in response to a consumed state change event. Called by AETier._executeTask.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible
  • layer (integer) - Layer on which the event occurred
  • task_name (string) - Name of the task this function executes.
  • name (string) - Name of the state that changed
  • value (boolean) - True if the state is now set, False if not

onStateChange(self, **kwargs)

source code 
Executes this EventScript in response to a state change event. Called by AETier._executeTask.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • name (string) - Name of the state that changed.
  • value (boolean) - True if the state is now set, False if not.
Returns: boolean
True to allow other tasks to process this event

updateOnTableChange(self, **kwargs)

source code 
Updates this EventScript in response to a consumed table change event. Called by AETier._executeTask.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • is_row (boolean) - True if a table row, False if a table column.
  • added (boolean) - True when a row/column is added, False when removed, None when reordered
  • first_child_por (AEPor) - The AEPor of first inserted/deleted row/column.
  • last_child_por (AEPor) - The AEPor of last inserted/deleted row/column.

onTableChange(self, **kwargs)

source code 
Executes this EventScript in response to a hierarchy change event. Called by AETier._executeTask.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • is_row (boolean) - True if a table row, False if a table column.
  • added (boolean) - True when a row/column is added, False when removed, None when reordered.
  • first_child_por (AEPor) - The AEPor of first inserted/deleted row/column.
  • last_child_por (AEPor) - The AEPor of last inserted/deleted row/column.
Returns: boolean
True to allow other tasks to process this event

onTableRowInserted(self, **kwargs)

source code 
Executes this EventScript in response to a row-inserted table change event. Called by onTableChange.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • is_row (boolean) - True if a table row.
  • added (boolean) - True when a row is added.
  • first_child_por (AEPor) - The AEPor of first inserted row.
  • last_child_por (AEPor) - The AEPor of last inserted row.
Returns: boolean
True to allow other tasks to process this event

onTableRowDeleted(self, **kwargs)

source code 
Executes this EventScript in response to a row-deleted table change event. Called by onTableChange.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • is_row (boolean) - True if a table row.
  • added (boolean) - False when a row removed.
  • first_child_por (AEPor) - The AEPor of first deleted row
  • last_child_por (AEPor) - The AEPor of last deleted row
Returns: boolean
True to allow other tasks to process this event

onTableRowReordered(self, **kwargs)

source code 
Executes this EventScript in response to a row-reordered table change event. Called by onTableChange.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible
  • layer (integer) - Layer on which the event occurred
  • task_name (string) - Name of the task this function executes.
  • is_row (boolean) - True if a table row, False if a table column.
  • added (boolean) - None when a row reordered.
  • first_child_por (AEPor) - The AEPor of first inserted/deleted row
  • last_child_por (AEPor) - The AEPor of last inserted/deleted row
Returns: boolean
True to allow other tasks to process this event

onTableColumnInserted(self, **kwargs)

source code 
Executes this EventScript in response to a column-inserted table change event. Called by onTableChange.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • is_row (boolean) - True if a table row, False if a table column.
  • added (boolean) - True when a column is added
  • first_child_por (AEPor) - The AEPor of first inserted column
  • last_child_por (AEPor) - The AEPor of last inserted column
Returns: boolean
True to allow other tasks to process this event

onTableColumnDeleted(self, **kwargs)

source code 
Executes this EventScript in response to a column-deleted table change event. Called by onTableChange.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • is_row (boolean) - False if a table column.
  • added (boolean) - False when a column removed.
  • first_child_por (AEPor) - The AEPor of first deleted column.
  • last_child_por (AEPor) - The AEPor of last deleted column.
Returns: boolean
True to allow other tasks to process this event

onTableColumnReordered(self, **kwargs)

source code 
Executes this EventScript in response to a column-reordered table change event. Called by onTableChange.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • is_row (boolean) - True if a table row, False if a table column.
  • added (boolean) - None when a column reordered.
  • first_child_por (AEPor) - The AEPor of first inserted/deleted column.
  • last_child_por (AEPor) - The AEPor of last inserted/deleted column.
Returns: boolean
True to allow other tasks to process this event

updateOnViewChange(self, **kwargs)

source code 
Updates this EventScript in response to a consumed view change event. Called by AETier._executeTask.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • title (string) - Title of the view.
  • gained (integer) - The kind of view change event.

onViewChange(self, **kwargs)

source code 
Executes this EventScript in response to a view change event. Called by AETier._executeTask.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • title (string) - Title of the view.
  • gained (integer) - The kind of view change event.
Returns: boolean
True to allow other tasks to process this event.

onViewGained(self, **kwargs)

source code 
Executes this EventScript in response to a view gained event. Called by onViewChange.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • title (string) - Title of the view.
  • gained (integer) - The kind of view change event.
Returns: boolean
True to allow other tasks to process this event.

onViewLost(self, **kwargs)

source code 
Executes this EventScript in response to a view lost event. Called by onViewChange.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • title (string) - Title of the view.
  • gained (integer) - The kind of view change event.
Returns: boolean
True to allow other tasks to process this event.

onViewStartup(self, **kwargs)

source code 
Executes this EventScript in response to the view being identified during SUE startup. Called by onViewChange.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • title (string) - Title of the view.
  • gained (integer) - The kind of view change event.
Returns: boolean
True to allow other tasks to process this event.

onViewFirstGained(self, **kwargs)

source code 
Executes this EventScript in response to the view being identified as the active view during SUE startup. Called by onViewChange.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • title (string) - Title of the view.
  • gained (integer) - The kind of view change event.
Returns: boolean
True to allow other tasks to process this event.

onChooserChange(self, **kwargs)

source code 
Executes a registered task function in response to some change in a AEChooser, starting it, ending it, or applying its current options. Called by AETier._executeTask.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • chooser (AEChooser) - Chooser that fired the event.
  • kind (integer) - Kind of signal, APPLY, OK, or CANCEL or an arbitrary constant provided by the AEChooser.
Returns: boolean
Should processing continue? Always returns True by default.

onChooserStart(self, **kwargs)

source code 
Executes a registered task function to start a new AEChooser, typically in response to input on an AEInput device. Called by onChooserChange.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
Returns: boolean
Should processing continue? Always returns True by default.

onChooserSignal(self, **kwargs)

source code 
Executes a registered task function in response to a chooser request to have its current options immediately applied without its completion. Called by onChooserChange.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • chooser (AEChooser) - Chooser that fired the event.
  • kind (integer) - Kind of signal, APPLY, OK, or CANCEL or an arbitrary constant provided by the AEChooser
Returns: boolean
Should processing continue? Always returns True by default.

onChooserEnd(self, **kwargs)

source code 

Executes a registered task function in response to the ending of a chooser dialog. Called by onChooserChange.

The default implementation calls AEScript.unregisterChooserTask which is the desired behavior for most AEChooser.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.
  • por (AEPor) - Point of regard for the related accessible.
  • layer (integer) - Layer on which the event occurred.
  • task_name (string) - Name of the task this function executes.
  • chooser (AEChooser) - Chooser that fired the event.
  • kind (integer) - Kind of signal, APPLY, OK, or CANCEL or an arbitrary constant provided by the AEChooser.
Returns: boolean
Should processing continue? Always returns True by default.

chainNewEventTaskAround(self, new_task, old_task, old_task_script=None, *functions_to_replace)

source code 

Allows to only replace certain parts of another event task.

Registers the new task and chains it around the old one. If the relevant event comes in, there will be a test which of the two events should be executed.

Example: A 'new task' wants to replace part of the execution to a CaretChange event. The 'new task' is only interested in this event when a caret move occured. :
 self.chainNewEventTaskAround('new task',
                              'read caret', 'BasicSpeechScript',
                              'onCaretMoved')
When a caret move comes in, the new task will be called, but when an update on the caret event is necessary or an caret inserted or caret deleted comes in, the 'read caret' task will be executed.
Parameters:
  • new_task (string) - Name of the new event task. This task can't be an already registered task.
  • old_task (string) - Name of the task that will be replaced partly.
  • old_task_script (string) - Name of the script.
  • functions_to_replace (list of strings) - List of function names, that shall be replaced.

updateAroundTask(self, **kwargs)

source code 
Needed in context to chainNewEventTaskAround for the decision which update function should be executed.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.

executeAroundTask(self, **kwargs)

source code 
Needed in context to chainNewEventTaskAround for the decision which execute function should be called.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.

Note: This function should be removed. It's functionality should be included in the on...Change(self, **kwargs) methods. Right now the decision is made in two places (redundancy).

_doReplacedTask(self, **kwargs)

source code 
Needed in context with chainNewEventTaskAround.
Parameters:
  • kwargs (dictionary) - Arbitrary data given by the observer.