orca.input_event (version 1529, $Date$)
index
/usr/lib/python2.5/site-packages/orca/input_event.py

Provides support for handling input events.  This provides several classes
to define input events (InputEventKeyboardEventBrailleEvent,
MouseButtonEventMouseMotionEvent, and SpeechEvent), and also provides a
InputEventHandler class.  It is intended that instances of InputEventHandler
will be used which should be used to handle all input events.

 
Modules
       
orca.atspi
orca.debug
orca.settings
time

 
Classes
       
InputEvent
BrailleEvent
KeyboardEvent
MouseButtonEvent
MouseMotionEvent
SpeechEvent
InputEventHandler

 
class BrailleEvent(InputEvent)
     Methods defined here:
__init__(self, event)
Creates a new InputEvent of type BRAILLE_EVENT.
 
Arguments:
- event: the integer BrlTTY command for this event.

 
class InputEvent
     Methods defined here:
__init__(self, type)
Creates a new input event of the given type.
 
Arguments:
- type: the input event type (one of KEYBOARD_EVENT, BRAILLE_EVENT,
        MOUSE_BUTTON_EVENT, MOUSE_MOTION_EVENT, SPEECH_EVENT).

 
class InputEventHandler
     Methods defined here:
__init__(self, function, description, learnModeEnabled=True)
Creates a new InputEventHandler instance.  All bindings
(e.g., key bindings and braille bindings) will be handled
by an instance of an InputEventHandler.
 
Arguments:
- function: the function to call with an InputEvent instance as its
            sole argument.  The function is expected to return True
            if it consumes the event; otherwise it should return
            False
- description: a localized string describing what this InputEvent
               does
- learnModeEnabled: if True, the description will be spoken and
                    brailled if learn mode is enabled.  If False,
                    the function will be called no matter what.
processInputEvent(self, script, inputEvent)
Processes an input event.  If settings.learnModeEnabled is True,
this will merely report the description of the input event to braille
and speech.  If settings.learnModeEnabled is False, this will call the
function bound to this InputEventHandler instance, passing the
inputEvent as the sole argument to the function.
 
This function is expected to return True if it consumes the
event; otherwise it is expected to return False.
 
Arguments:
- script:     the script (if any) associated with this event
- inputEvent: the input event to pass to the function bound
              to this InputEventHandler instance.

 
class KeyboardEvent(InputEvent)
     Methods defined here:
__init__(self, event)
Creates a new InputEvent of type KEYBOARD_EVENT.
 
Arguments:
- event: the AT-SPI keyboard event

 
class MouseButtonEvent(InputEvent)
     Methods defined here:
__init__(self, event)
Creates a new InputEvent of type MOUSE_BUTTON_EVENT.

 
class MouseMotionEvent(InputEvent)
     Methods defined here:
__init__(self, event)
[[[TODO: WDW - undefined at the moment.]]]

 
class SpeechEvent(InputEvent)
     Methods defined here:
__init__(self, event)
[[[TODO: WDW - undefined at the moment.]]]

 
Data
        BRAILLE_EVENT = 'braille'
KEYBOARD_EVENT = 'keyboard'
MOUSE_BUTTON_EVENT = 'mouse:button'
MOUSE_MOTION_EVENT = 'mouse:motion'
SPEECH_EVENT = 'speech'
__copyright__ = 'Copyright (c) 2005-2006 Sun Microsystems Inc.'
__date__ = '$Date$'
__id__ = '$Id$'
__license__ = 'LGPL'
__version__ = '$Revision$'