Module tetra::input

source ·
Expand description

Functions and types relating to handling the player’s input.

Gamepads

When accessing gamepad state, you specify which gamepad you’re interested in via a ‘gamepad ID’. The first gamepad connected to the system has ID 0, the second has ID 1, and so on.

If a controller is disconnected, the next controller to be connected will take its ID - otherwise, a new one will be allocated. This means that if you unplug a controller and then plug it back in, it should retain its existing ID. This behaviour might be made smarter in future versions.

Examples

The keyboard example demonstrates how to handle keyboard input.

The mouse example demonstrates how to handle mouse input.

The gamepad example demonstrates how to handle gamepad input.

The text_input example demonstrates how to handle text entry.

Enums

Functions