Package muntjac :: Package event :: Module shortcut_listener :: Class ShortcutListener
[hide private]
[frames] | no frames]

Class ShortcutListener

source code

                object --+        
                         |        
             action.Action --+    
                             |    
shortcut_action.ShortcutAction --+
                                 |
                    object --+   |
                             |   |
              action.IListener --+
                                 |
                                ShortcutListener

Instance Methods [hide private]
 
__init__(self, *args)
Creates a shortcut either using a shorthand notation to encode the keycode a in the caption or one that reacts to the given KeyCode and (optionally) ModifierKeys.
source code
 
handleAction(self, sender, target) source code

Inherited from shortcut_action.ShortcutAction: getKeyCode, getModifiers

Inherited from action.Action: __eq__, getCaption, getIcon, setCaption, setIcon

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

Class Variables [hide private]

Inherited from shortcut_action.ShortcutAction: SHORTHAND_CHAR_ALT, SHORTHAND_CHAR_CTRL, SHORTHAND_CHAR_SHIFT

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, *args)
(Constructor)

source code 

Creates a shortcut either using a shorthand notation to encode the keycode a in the caption or one that reacts to the given KeyCode and (optionally) ModifierKeys.

The shortcut might be shown in the UI (e.g context menu), in which case the caption will be used.

Insert one or more modifier characters before the character to use as keycode. E.g "&Save" will make a shortcut responding to ALT-S, "E^xit" will respond to CTRL-X.<br/> Multiple modifiers can be used, e.g "&^Delete" will respond to CTRL-ALT-D (the order of the modifier characters is not important).

The modifier characters will be removed from the caption. The modifier character is be escaped by itself: two consecutive characters are turned into the original character w/o the special meaning. E.g "Save&&&close" will respond to ALT-C, and the caption will say "Save&close".

Parameters:
  • args - tuple of the form
    • (caption, kc, m)
      1. used when displaying the shortcut visually
      2. KeyCode that the shortcut reacts to
      3. optional modifier keys
    • (caption, icon, kc, m)
      1. used when displaying the shortcut visually
      2. used when displaying the shortcut visually
      3. KeyCode that the shortcut reacts to
      4. optional modifier keys
    • (shorthandCaption)
      1. the caption in modifier shorthand
    • (shorthandCaption, modifierKeys)
      1. the caption in modifier shorthand
      2. modifier keys
Overrides: object.__init__
(inherited documentation)

handleAction(self, sender, target)

source code 
Overrides: action.IListener.handleAction