Skip to main content

Reset gamepad state (:reset)

This method is available in versions after 20260805

Declaration​

success, err = pad:reset()

Returns​

  • success
    Boolean. True if the reset succeeds; false if the device is disconnected or busy, or if input delivery fails
  • err
    String. Error message when the operation fails

Description​

Releases all buttons and centers both analog sticks and the directional pad.

Example​

local pad = assert(gamepad.connect())

assert(pad:set_stick("left", 1, 0))
assert(pad:reset())
assert(pad:disconnect())