Input - Wantcha/Chimera GitHub Wiki

Working with Input

The Input Table

Input is a table containing all the functions required to check for different kinds of keyboard and mouse input from the user.

- bool Input.IsKeyDown (Key key)

Returns true for every frame that the specified key is pressed.

- bool Input.IsKeyPressed (Key key)

Returns true the first frame that the specified key is pressed.

- bool Input.IsMousePressed (int button)

Returns true for every frame that the specified mouse button is pressed. (0 is left-click, 1 is right-click, 2 is middle-click)

- pair Input.GetMousePosition ()

Returns the position of the mouse cursor in window pixel coordinates (where 0.0 is considered to be the bottom-left position of the window)

Keys

Key is an enumerator containing the name of all the keys available on a standard keyboard. Examples of accessing keys:

  • Key.A
  • Key.Space
  • Key.LeftAlt
  • Key.F2
  • Key.Enter
  • Key.Left
  • Key.Keypad7