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

Provides support for defining keybindings and matching them to input
events.

 
Modules
       
orca.atspi
orca.debug
gtk
orca.settings

 
Classes
       
KeyBinding
KeyBindings

 
class KeyBinding
    A single key binding, consisting of a keycode, a modifier mask,
and the InputEventHandler.
 
  Methods defined here:
__init__(self, keysymstring, modifier_mask, modifiers, handler)
Creates a new key binding.
 
Arguments:
- keysymstring: the keysymstring - this is typically a string
  from /usr/include/X11/keysymdef.h with the preceding 'XK_'
  removed (e.g., XK_KP_Enter becomes the string 'KP_Enter').
- modifier_mask: bit mask where a set bit tells us what modifiers
  we care about (see atspi.Accessibility.MODIFIER_*)
- modifiers: the state the modifiers we care about must be in for
  this key binding to match an input event (see also
  atspi.Accessibility.MODIFIER_*)
- handler: the InputEventHandler for this key binding
matches(self, keycode, modifiers)
Returns true if this key binding matches the given keycode and
modifier state.

 
class KeyBindings
    Structure that maintains a set of KeyBinding instances.
 
  Methods defined here:
__init__(self)
add(self, keyBinding)
Adds the given KeyBinding instance to this set of keybindings.
consumeKeyboardEvent(self, script, keyboardEvent)
Attempts to consume the given keyboard event.  If these
keybindings have a handler for the given keyboardEvent, it is
assumed the event will always be consumed.
getInputHandler(self, keyboardEvent)
Returns the input handler of the key binding that matches the
given keycode and modifiers, or None if no match exists.
hasKeyBinding(self, newKeyBinding, typeOfSearch='strict')
Return True if keyBinding is already in self.keyBindings.
 
The typeOfSearch can be:
   "strict":      matches description, modifiers, key
   "description": matches only description.
   "keys":        matches only modifiers and key.
remove(self, keyBinding)
Removes the given KeyBinding instance from this set of keybindings.
removeByHandler(self, handler)
Removes the given KeyBinding instance from this set of keybindings.

 
Functions
       
getModifierNames(mods)
Gets the modifier names of a numeric modifier mask as a human
consumable string.

 
Data
        __copyright__ = 'Copyright (c) 2005-2006 Sun Microsystems Inc.'
__date__ = '$Date$'
__id__ = '$Id$'
__license__ = 'LGPL'
__version__ = '$Revision$'