---@meta -- Generated from native/src/bindings/features/buttons.cpp. Do not edit. ---@alias Button "up"|"down"|"left"|"right"|"confirm"|"back" -- Roles, not physical buttons: a device maps whatever hardware it has onto them, and -- up/down/left/right are the directions tree.moveFocus already takes. ---@class ButtonsLib buttons = {} ---Returns the roles this device reports, so an app can label only the actions it has. ---@return Button[] function buttons.getAll() end ---Whether any button is held. ---@return boolean function buttons.isAnyPressed() end ---Whether a button is held. ---@param button Button ---@return boolean function buttons.isPressed(button) end ---Whether a button went down since the last poll. ---@param button Button ---@return boolean function buttons.wasPressed(button) end ---Whether a button came up since the last poll. ---@param button Button ---@return boolean function buttons.wasReleased(button) end -- What an app implements to see buttons, composed into its own class: -- -- ---@class MenuApp : App, ButtonHandlers ---@class ButtonHandlers ---@field onButtonDown? fun(button: Button) Fired when a button goes down. ---@field onButtonUp? fun(button: Button) Fired when a button comes up. ---@field onButton? fun(button: Button) Tap alias, fired on release like a click, after onButtonUp.