Release a gamepad button (:up)
This method is available in versions after 20260805
Declaration
success, err = pad:up(button)
Parameters
- button Integer or string. See button parameters for supported numbers and names
Returns
- success Boolean. True if the operation succeeds; false if the device is disconnected or busy, or if input delivery fails
- err String. Error message when the operation fails
Description
Releases the specified button. Invalid argument types, unknown names, and out-of-range values raise Lua argument errors.
Example
local pad = assert(gamepad.connect())
assert(pad:down("left_shoulder"))
assert(pad:up("left_shoulder"))
assert(pad:down(13))
assert(pad:up(13))
assert(pad:disconnect())