Package pajammin :: Module input :: Class _KeyListener
[show private | hide private]
[frames | no frames]

Class _KeyListener

Listener --+
           |
          _KeyListener

Known Subclasses:
KeyPressListener, KeyReleaseListener

Base class for key-related events.
Method Summary
  __init__(self, callback, cbdata, priority, key, keys)
  _addkey(self, key)
  is_relevant(self, event)
Return true if this listener's callback should be notified about the given event.
    Inherited from Listener
  __cmp__(self, other)
  handle(self, event)
  start(self)
  stop(self)

Class Variable Summary
SRE_Pattern _MODIFIED_KEY = ^(c-|a-|s-|ctrl-|alt-|shift-)+.$
NoneType event_type = None                                                                  

Method Details

__init__(self, callback, cbdata=(), priority=50, key=None, keys=None)
(Constructor)

Construct a new listener.
Parameters:
callback - The listener's callback function. When an relevant event occurs, this callback will be called with the event object, plus any arguments specified in cbdata.
cbdata - A tuple containing extra arguments for the callback function.
priority - The priority of this listener.
key - If specified, then only report events that use the given key.
keys - If specified, then only report events that use one of the given keys.
Overrides:
pajammin.input.Listener.__init__

_addkey(self, key)

is_relevant(self, event)

Return true if this listener's callback should be notified about the given event.
Overrides:
pajammin.input.Listener.is_relevant (inherited documentation)

Class Variable Details

_MODIFIED_KEY

Type:
SRE_Pattern
Value:
^(c-|a-|s-|ctrl-|alt-|shift-)+.$                                       

event_type

Type:
NoneType
Value:
None