Hardware Gamepad Module (gamepad)
This module is available in versions after 20260805
The gamepad module creates independent gamepad objects. Each call to gamepad.connect creates a new object whose buttons, analog sticks, directional pad, and lifecycle are independent of every other instance.
- ! Create a hardware gamepad (gamepad.connect)
- Hold down a gamepad button (:down)
- Release a gamepad button (:up)
- ! Press a gamepad button (:press)
- Set an analog-stick position (:set_stick)
- Set the directional-pad state (:set_dpad)
- Reset gamepad state (:reset)
- Check whether a gamepad is connected (:is_connected)
- Get gamepad device properties (:get_properties)
- Disconnect a hardware gamepad (:disconnect)