Package tdl :: Module event :: Class KeyEvent
[frames] | no frames]

Class KeyEvent

source code

object --+    
         |    
     Event --+
             |
            KeyEvent
Known Subclasses:

Instance Methods
 
__init__(self, key, char, lalt, lctrl, ralt, rctrl, shift)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__repr__(self)
List an events public attributes in print calls. (Inherited from tdl.event.Event)
source code

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

Class Variables
  type = None
String constant representing the type of event. (Inherited from tdl.event.Event)
Instance Variables
string key
Human readable name of the key pressed.
string char
A single character string of the letter or symbol pressed.
boolean leftAlt
boolean rightAlt
boolean leftCtrl
boolean rightCtrl
boolean shift
True if shift was held down during this event.
boolean alt
True if alt was held down during this event.
boolean control
True if control was held down during this event.
Properties

Inherited from object: __class__

Method Details

__init__(self, key, char, lalt, lctrl, ralt, rctrl, shift)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

Instance Variable Details

key

Human readable name of the key pressed.

Can be one of 'NONE', 'ESCAPE', 'BACKSPACE', 'TAB', 'ENTER', 'SHIFT', 'CONTROL', 'ALT', 'PAUSE', 'CAPSLOCK', 'PAGEUP', 'PAGEDOWN', 'END', 'HOME', 'UP', 'LEFT', 'RIGHT', 'DOWN', 'PRINTSCREEN', 'INSERT', 'DELETE', 'LWIN', 'RWIN', 'APPS', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'KP0', 'KP1', 'KP2', 'KP3', 'KP4', 'KP5', 'KP6', 'KP7', 'KP8', 'KP9', 'KPADD', 'KPSUB', 'KPDIV', 'KPMUL', 'KPDEC', 'KPENTER', 'F1', 'F2', 'F3', 'F4', 'F5', 'F6', 'F7', 'F8', 'F9', 'F10', 'F11', 'F12', 'NUMLOCK', 'SCROLLLOCK', 'SPACE', 'CHAR'

char

A single character string of the letter or symbol pressed.

Special characters like delete and return are not cross-platform. key should be used instead for special keys.