Module vrKey :: Class vrKey
[frames] | no frames]

Class vrKey

   object --+        
            |        
  ??.instance --+    
                |    
vrAEBase.vrAEBase --+
                    |
                   vrKey

The key class is used to define functionality to be called on key presses.

Examples:

       See also example key-action.py and keys.py
Instance Methods
 
__init__(key, modifier, level)
The constructor of the vrKey class.
string
getDescription()
Returns the description of the key.
integer (unsigned)
getKey()
Returns the key of this object.
integer (unsigned)
getLevel()
Returns the level of this object.
integer (unsigned)
getModifier()
Returns the modifier of this object.
bool
isEnabled()
Returns the enabled state of the key.
 
pressedModifier(modifier)
SIGNAL is called when a modifier key is pressed.
 
setDescription(description)
Sets an description for what this key event is about.
 
setEnabled(state)
Enables or disables the key.

Inherited from vrAEBase.vrAEBase: __reduce__, addLoop, callAllConnected, connect, connectSignal, emitSignal, getModuleName, isActive, loop, recEvent, removeConnections, setActive, setUpdateGUIEnabled, subLoop

Inherited from unreachable.instance: __new__

Class Variables
  __instance_size__ = 176
Method Details

__init__(key, modifier, level)
(Constructor)

 

The constructor of the vrKey class. Actually there are 4 constructors for this class.

vrKey() creates a key callback object.

vrKey(key) creates a key callback object without modifiers.

vrKey(key,modifier) creates a key callback object with modifiers.

vrKey(level,key,modifier) creates a key callback object with modifiers that is active only in a specified keyboard level. If you specify -1 as keyboard level, the key will work within all levels.

Parameters:
  • key (integer (unsigned)) - the keycode. Valid keycodes are:

    Key_A - Key_Z

    Key_0 - Key_9

    Key_F1 - Key_F35

    Key_Escape

    Key_Tab, Key_Backtab

    Key_BackSpace

    Key_Return, Key_Enter

    Key_Insert, Key_Delete

    Key_Pause

    Key_Print

    Key_SysReq

    Key_Home, Key_End

    Key_Left, Key_Up, Key_Right, Key_Down

    Key_Prior

    Key_PageUp, Key_PageDown

    Key_Next

    Key_CapsLock, Key_NumLock, Key_ScrollLock

    Key_Super_L & Key_Super_R

    Key_Menu

    Key_Hyper_L & Key_Hyper_R

    Key_Help

    Key_Space

    Key_Any

    Key_Exclam

    Key_QuoteDbl

    Key_NumberSign

    Key_Dollar

    Key_Percent

    Key_Ampersand

    Key_Apostrophe

    Key_ParenLeft & Key_ParenRight

    Key_Asterisk

    Key_Plus

    Key_Comma

    Key_Minus

    Key_Period

    Key_Slash

    Key_Colon

    Key_Semicolon

    Key_Less, Key_Equal, Key_Greater

    Key_Question

    Key_At

    Key_BracketLeft & Key_BracketRight

    Key_Backslash

    Key_AsciiCircum

    Key_Underscore

    Key_QuoteLeft

    Key_BraceLeft & Key_BraceRight

    Key_Bar

    Key_AsciiTilde

    Key_nobreakspace

    Key_exclamdown

    Key_cent

    Key_sterling

    Key_currency

    Key_yen

    Key_brokenbar

    Key_section

    Key_diaeresis

    Key_copyright

    Key_ordfeminine

    Key_guillemotleft

    Key_notsign

    Key_hyphen

    Key_registered

    Key_macron

    Key_degree

    Key_plusminus

    Key_twosuperior

    Key_threesuperior

    Key_acute

    Key_mu

    Key_paragraph

    Key_periodcentered

    Key_cedilla

    Key_onesuperior

    Key_masculine

    Key_guillemotright

    Key_onequarter

    Key_onehalf

    Key_threequarters

    Key_questiondown

    Key_Agrave

    Key_Aacute

    Key_Acircumflex

    Key_Atilde

    Key_Adiaeresis

    Key_Aring

    Key_AE

    Key_Ccedilla

    Key_Egrave

    Key_Eacute

    Key_Ecircumflex

    Key_Ediaeresis

    Key_Igrave

    Key_Iacute

    Key_Icircumflex

    Key_Idiaeresis

    Key_ETH

    Key_Ntilde

    Key_Ograve

    Key_Oacute

    Key_Ocircumflex

    Key_Otilde

    Key_Odiaeresis

    Key_multiply

    Key_Ooblique

    Key_Ugrave

    Key_Uacute

    Key_Ucircumflex

    Key_Udiaeresis

    Key_Yacute

    Key_THORN

    Key_ssharp

    Key_agrave

    Key_aacute

    Key_acircumflex

    Key_atilde

    Key_adiaeresis

    Key_aring

    Key_ae

    Key_ccedilla

    Key_egrave

    Key_eacute

    Key_ecircumflex

    Key_ediaeresis

    Key_igrave

    Key_iacute

    Key_icircumflex

    Key_idiaeresis

    Key_eth

    Key_ntilde

    Key_ograve

    Key_oacute

    Key_ocircumflex

    Key_otilde

    Key_odiaeresis

    Key_division

    Key_oslash

    Key_ugrave

    Key_uacute

    Key_ucircumflex

    Key_udiaeresis

    Key_yacute

    Key_thorn

    Key_ydiaeresis

    Key_unknown

  • modifier (integer (unsigned)) - The modifiers of the key (AltButton, ControlButton, ShiftButton, and/or Keypad). If you need a combination, simply combine them with the bit-wise or operator.
  • level (integer (unsigned)) - the keyboard level the key is in.
Overrides: vrAEBase.vrAEBase.__init__

getDescription()

 

Returns the description of the key.

Returns: string
The description text.

getKey()

 

Returns the key of this object.

Returns: integer (unsigned)
The key.

getLevel()

 

Returns the level of this object.

Returns: integer (unsigned)
The level.

getModifier()

 

Returns the modifier of this object.

Returns: integer (unsigned)
The modifier.

isEnabled()

 

Returns the enabled state of the key.

Returns: bool
The state of the key: On/Off.

pressedModifier(modifier)

 

SIGNAL is called when a modifier key is pressed.

Parameters:
  • modifier (integer (unsigned)) - The modifiers of the key (AltButton, ControlButton, ShiftButton, and/or Keypad). If you need a combination, simply combine them with the bit-wise or operator.

setDescription(description)

 

Sets an description for what this key event is about.

Parameters:
  • description (string) - The description text.

setEnabled(state)

 

Enables or disables the key.

Parameters:
  • state (bool) - The state of the key: On/Off.