Package AccessEngine :: Package AEAccAdapters :: Package ATSPI :: Module DefaultEventHandler :: Class DefaultEventHandlerAdapter
[hide private]
[frames] | no frames]

Class DefaultEventHandlerAdapter

source code

               object --+    
                        |    
AEAccAdapter.AEAccAdapter --+
                            |
                           DefaultEventHandlerAdapter

Adapts all events from AT-SPI accessibles to the interfaces defined in provides. No condition for adaption is given implying that this adapter is used as a default by AEAccAdapter when no better adapter is available.

This class is meant to be subclassed by more specific event handlers. Only the protected handler methods (those starting with _handle) need to be overridden as the public method getAEEvents will call the most child implementation of the appropriate event handling method.

Instance Methods [hide private]
list of string
getRawEvents(self, kind)
Gets a list of raw AT-SPI event names that map to the given kind of AEEvent.
source code
 
getAEViewEvents(self, event, collector, vm)
Determines if the active view has changed and what events need to be fired in response.
source code
 
getAEEvents(self, event, collector)
Determines what AEEvents should be posted to AEEventManager for later execution by a AETier based on the provided raw pyatspi.event.Event.
source code
tuple of AEEvent
_handleUnfocusEvent(self, source, **kwargs)
Creates an AEEvent.FocusChange indicating that the accessible being adapted has lost the focus.
source code
boolean
_filterFocusEvent(self, event)
Determines if a focus event is a repeat on an already focused object or not.
source code
tuple of AEEvent
_handleFocusEvent(self, event, **kwargs)
Creates an AEEvent.FocusChange indicating that the accessible being adapted has gained the focus.
source code
tuple of AEEvent
_handlePropertyEvent(self, event, **kwargs)
Creates an AEEvent.PropertyChange indicating that some simple property of an accessible changed.
source code
tuple of AEEvent
_handleStateEvent(self, event, **kwargs)
Creates an AEEvent.StateChange indicating that some simple property of an accessible changed.
source code
tuple of AEEvent
_handleChildrenEvent(self, event, **kwargs)
Creates an AEEvent.ChildrenChange indicating that a child has been added/ removed to an accessible.
source code
tuple of AEEvent
_handleTableEvent(self, event, **kwargs)
Creates an AEEvent.TableChange indicating a insert/delete/reorder of a row/column in a table-based accessible.
source code
tuple of AEEvent
_handleScreenEvent(self, event, **kwargs)
Creates an AEEvent.ScreenChange event in response to a visible data or bounds change on an object or text.
source code
tuple of AEEvent
_handleMouseEvent(self, event, **kwargs)
Creates an AEEvent.ScreenChange event in response to a visible data or bounds change on an object or text.
source code
tuple of AEEvent
_handleKeyPressEvent(self, event, **kwargs)
Creates an AEEvent.PrivateChange event in response to a key press on the keyboard.
source code

Inherited from AEAccAdapter.AEAccAdapter: __call__, __init__

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

Class Variables [hide private]
list of Interface provides = [IEventHandler]
Interfaces provided by this adapter
boolean singleton = True
If True, only one instance of this adapter will be registered for use such that it is reused for all subjects.
pyatspi.Accessibility.Accessible last_focus = None
Last accessible to receive focus

Inherited from AEAccAdapter.AEAccAdapter: when

Instance Variables [hide private]

Inherited from AEAccAdapter.AEAccAdapter: subject

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

getRawEvents(self, kind)

source code 
Gets a list of raw AT-SPI event names that map to the given kind of AEEvent.
Parameters:
  • kind (AEEvent class) - Indicates the type of AEEvent some part of the system wants to be able to process
Returns: list of string
List of AT-SPI event names
Raises:
  • KeyError - When no mapping exists for the given event

getAEViewEvents(self, event, collector, vm)

source code 
Determines if the active view has changed and what events need to be fired in response. The possible cases include a normal view change (app1 window to app2 window), a floating widget change (app1 window to app1 floater), or a overlay change (app1 window to app2 floater). Resets the last focus when the third case occurs so that the first application can announce its restored focus when the floater goes away. For instance, if the metacity task switcher appears and the user immediately closes it, he lands right back in the window where he started. In this case, the new focus is the last focus, but we still want to announce it.
Parameters:
  • event (pyatspi.event.Event) - Raw event
  • collector (callable) - Callable object that collects AEEvents to process. Accepts N parameters of type AEEvent.
  • vm (AEViewManager) - Reference to the view manager that has information about the current view and needs to store a reference to a new view

getAEEvents(self, event, collector)

source code 
Determines what AEEvents should be posted to AEEventManager for later execution by a AETier based on the provided raw pyatspi.event.Event. Makes an initial decision about whether the event occurred in a focused control or an unfocused control.
Parameters:
  • event (pyatspi.event.Event) - Raw event
  • collector (callable) - Callable object that collects AEEvents to process. Accepts N parameters of type AEEvent.

_handleUnfocusEvent(self, source, **kwargs)

source code 
Creates an AEEvent.FocusChange indicating that the accessible being adapted has lost the focus.
Parameters:
  • source (pyatspi.Accessibility.Accessible) - Source of the last raw focus change event
  • kwargs (dictionary) - Parameters to be passed to any created AEEvent
Returns: tuple of AEEvent
AEEvent.FocusChange

_filterFocusEvent(self, event)

source code 
Determines if a focus event is a repeat on an already focused object or not.
Parameters:
  • event (pyatspi.Accessibility.Accessible) - Source of the last raw focus change event
Returns: boolean
True if this method believes the event should be ignored, False if not

_handleFocusEvent(self, event, **kwargs)

source code 
Creates an AEEvent.FocusChange indicating that the accessible being adapted has gained the focus. Also creates a AEEvent.SelectorChange. These two AEEvents will be posted by the caller.
Parameters:
  • event (pyatspi.event.Event) - Raw focus change event
  • kwargs (dictionary) - Parameters to be passed to any created AEEvent
Returns: tuple of AEEvent
AEEvent.FocusChange and AEEvent.SelectorChange

_handlePropertyEvent(self, event, **kwargs)

source code 

Creates an AEEvent.PropertyChange indicating that some simple property of an accessible changed. These two AEEvents will be posted by the caller.

The AEPor for the event soruce returned by this method will be marked as incomplete as the accessible may actually be an item. It will be resolved at a later time by the AEEvent if the event will actually be processed.
Parameters:
  • event (pyatspi.event.Event) - Raw property change event
  • kwargs (dictionary) - Parameters to be passed to any created AEEvent
Returns: tuple of AEEvent
Property change event

_handleStateEvent(self, event, **kwargs)

source code 

Creates an AEEvent.StateChange indicating that some simple property of an accessible changed. These two AEEvents will be posted by the caller.

The AEPor for the event soruce returned by this method will be marked as incomplete as the accessible may actually be an item. It will be resolved at a later time by the AEEvent if the event will actually be processed.
Parameters:
  • event (pyatspi.event.Event) - Raw state change event
  • kwargs (dictionary) - Parameters to be passed to any created AEEvent
Returns: tuple of AEEvent
AEEvent.StateChange event

_handleChildrenEvent(self, event, **kwargs)

source code 

Creates an AEEvent.ChildrenChange indicating that a child has been added/ removed to an accessible. This AEEvent will be posted by the caller.

The AEPor for the event soruce returned by this method will be marked as incomplete as the accessible may actually be an item. It will be resolved at a later time by the AEEvent if the event will actually be processed.
Parameters:
  • event (pyatspi.event.Event) - Raw children change event
  • kwargs (dictionary) - Parameters to be passed to any created AEEvent
Returns: tuple of AEEvent
AEEvent.ChildrenChange event

_handleTableEvent(self, event, **kwargs)

source code 
Creates an AEEvent.TableChange indicating a insert/delete/reorder of a row/column in a table-based accessible. This AEEvent will be posted by the caller.
Parameters:
  • event (pyatspi.event.Event) - Raw table change event
  • kwargs (dictionary) - Parameters to be passed to any created AEEvent
Returns: tuple of AEEvent
AEEvent.TableChange event

_handleScreenEvent(self, event, **kwargs)

source code 
Creates an AEEvent.ScreenChange event in response to a visible data or bounds change on an object or text.
Parameters:
  • event (pyatspi.event.Event) - Raw visibility or bounds change event
  • kwargs (dictionary) - Parameters to be passed to any created AEEvent
Returns: tuple of AEEvent
AEEvent.ScreenChange event

_handleMouseEvent(self, event, **kwargs)

source code 
Creates an AEEvent.ScreenChange event in response to a visible data or bounds change on an object or text.
Parameters:
  • event (pyatspi.event.Event) - Raw visibility or bounds change event
  • kwargs (dictionary) - Parameters to be passed to any created AEEvent
Returns: tuple of AEEvent
AEEvent.ScreenChange event

_handleKeyPressEvent(self, event, **kwargs)

source code 
Creates an AEEvent.PrivateChange event in response to a key press on the keyboard. This event is kept private because AEScripts and tasks should not be relying on key codes and key syms to trigger actions, but rather using abstracted AEEvent.InputGesture events and Input-Tasks.
Parameters:
  • event (pyatspi.event.Event) - Raw keyboard event
  • kwargs (dictionary) - Parameters to be passed to any created AEEvent
Returns: tuple of AEEvent
AEEvent.PrivateChange event