Layer.onKeyDown

Function/Meaning

The key was pressed

Type
LayerclassEvent
Syntax
onKeyDown(key, shift, process=true)
Arguments
key

The value of the virtual key code of the pressed key.

shift

This is the state of shift-type keys and mouse buttons that were pressed at the same time when the keys were pressed.
It is a combination of the following values by bit OR.

  • ssAlt : The ALT key was pressed
  • ssShift : The SHIFT key was pressed
  • ssCtrl : CTRL key was pressed
  • ssLeft : The left mouse button was pressed
  • ssMiddle : The middle mouse button was pressed
  • ssRight : The right mouse button was pressed

Also, if the keyboard is pressed for a long time and key repeat occurs, the following values are also combined.

  • ssRepeat : Key repeat occurred
process

If you pass false to this argument when calling onKeyDown of the parent class, the parent class will not do the default processing for that key (such as moving focus).

Return value
None (void)
Explanation

Occurs when a key is pressed.