pyunity.input module

Module to manage getting input from window providers.

This will be imported as pyunity.Input.

class pyunity.input.Code(vals)[source]

Bases: object

Represents a key on a keyboard. Do not instantiate this class.

pyunity.input.GetKey(keycode)[source]

Check if key has been pressed.

Parameters:keycode (KeyCode) – Key to query
Returns:1 if pressed and 0 if not pressed.
Return type:int
pyunity.input.GetKeyDown(keycode)[source]

Check if key was pressed down this frame.

Parameters:keycode (KeyCode) – Key to query
Returns:1 if pressed and 0 if not pressed.
Return type:int
pyunity.input.GetKeyUp(keycode)[source]

Check if key was released this frame.

Parameters:keycode (KeyCode) – Key to query
Returns:1 if released and 0 if not released.
Return type:int
class pyunity.input.KeyCode[source]

Bases: object

KeyCodes to reference each key on the keyboard. Do not instantiate this class.