KeyBinder

KeyBinder is a mix-in that facilitates binding keys to windows. Derived classes should use the bindKey() method to bind a key sequence (without enclosing angle brackets) to a callable object which accepts no parameters.

Methods

__init__(self, top)

   def __init__(self, top = None):

Constructs a keybinder. top should be the toplevel window that events should be bound to (it can also be a non-toplevel window for local binding). If top is not specified, attempts to determine the toplevel window from self.

_keyEvent(self, evt)

   def _keyEvent(self, evt):

Event handler method. Called when any key event is

bindKey(self, keySequence, action)

   def bindKey(self, keySequence, action):

Binds the keySequence to the action. It is not necessary to enclose the sequence in angle brackets.