pyLinAcc :: Event :: DeviceObserver :: Class DeviceObserver
[hide private]
[frames] | no frames]

Class DeviceObserver

source code

                            object --+    
                                     |    
                              Observer --+
                                         |
Accessibility__POA.DeviceEventListener --+
                                         |
                                        DeviceObserver

Observes keyboard press and release events. The settings for the listener mode are hard coded so that key presses and releases can be consumed by any client registered with the Manager to observe these events.

Instance Methods [hide private]
 
__init__(self, manager)
Creates a mode object that defines when key events will be received from the system.
source code
 
register(self, registry, name)
Starts keyboard event monitoring on all keys and key combinations.
source code
 
unregister(self, registry, name)
Stops keyboard event monitoring on all keys and key combinations.
source code
Accessibility.EventListener
queryInterface(self, repo_id)
Reports that this class only implements the AT-SPI DeviceEventListener interface.
source code
boolean
notifyEvent(self, event)
Notifies the Manager that an event has occurred.
source code

Inherited from Observer: clientRef, clientUnref, getClientRefCount, ref, unref

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

Instance Variables [hide private]
Accessibility.EventListenerMode mode
Keyboard event mode (currently hardwired as non-preemptive and asynchronous)

Inherited from Observer: manager, ref_count

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, manager)
(Constructor)

source code 

Creates a mode object that defines when key events will be received from the system.

Parameters:
Overrides: Observer.__init__

register(self, registry, name)

source code 

Starts keyboard event monitoring on all keys and key combinations. The event type to be monitored (key press or key release) is given by the event name. See Manager.addClient for valid event names.

Parameters:
  • registry (Accessibility.Registry) - Registry where the device event controller is defined
  • name (string) - pyLinAcc.Constants keyboard event name

unregister(self, registry, name)

source code 

Stops keyboard event monitoring on all keys and key combinations. The event type to stop monitoring (key press or key release) is given by the event name. See Manager.addClient for possible event names.

Parameters:
  • registry (Accessibility.Registry) - Registry where the device event controller is defined
  • name (string) - Pretty AT-SPI event name

queryInterface(self, repo_id)

source code 

Reports that this class only implements the AT-SPI DeviceEventListener interface. Required by AT-SPI.

Parameters:
  • repo_id (string) - Request for an interface
Returns: Accessibility.EventListener
The underlying CORBA object for the device event listener

notifyEvent(self, event)

source code 

Notifies the Manager that an event has occurred. Wraps the raw event object in our Event class to support automatic ref and unref calls. An observer can set the Event consume flag to True to indicate this event should not be allowed to pass to other AT-SPI observers or the underlying application.

Parameters:
  • event (Accessibility.DeviceEvent) - Low-level AT-SPI event (keyboard, mouse)
Returns: boolean
Should the event be consumed (True) or allowed to pass on to other AT-SPI observers (False)?