PIXELFALLS
  • Docs
  • Hardware
  • News
  • Roadmap
  • Pricing
  • Schools
SchoolsHardwareTerms of ServicePrivacy Policy

© 2026 PIXELFALLS

Documentation

Input

Button constants

buttonDown() and buttonPressed() can also be called with no parameters to query whether any tracked logical button is currently held/pressed.

Games always use logical BTN_* constants. Keyboard and standard game controllers both drive these buttons (any attached pad is combined with the keyboard). Default bindings are listed below.

Remapping controls

Open the in-game pause menu (Escape on keyboard or Start on a gamepad), choose CONTROLS, then pick KEYBOARD or CONTROLLER to remap each logical button. Bindings are saved in your browser and apply to every PIXELFALLS game you play on that device. Use RESET DEFAULTS to restore the stock layout.

D-pad directions can be remapped on a gamepad; the left stick still moves as an alternate. Pause menu keys (Escape, Start, Enter) are not remappable.

Controller names follow the Xbox layout used by SDL. PlayStation, Switch, and similar pads still work — the letter printed on the plastic may differ.

ConstantRoleDefault keyGamepad
BTN_UPD-pad upArrow UpD-pad Up or left stick up
BTN_DOWND-pad downArrow DownD-pad Down or left stick down
BTN_LEFTD-pad leftArrow LeftD-pad Left or left stick left
BTN_RIGHTD-pad rightArrow RightD-pad Right or left stick right
BTN_AFace button AZA (south)
BTN_BFace button BXB (east)
BTN_CFace button CAX (west)
BTN_DFace button DSY (north)
BTN_LShoulder LQLeft shoulder
BTN_RShoulder RWRight shoulder

Escape / pause is handled by the engine menu and is not a game BTN_* constant. On a gamepad, Start toggles the pause menu. While the menu is open, D-pad or left stick Up/Down move the selection and A confirms (same as Enter). Analog triggers, the right stick, and the Guide/home button are ignored.

Functions

buttonDown

Return true while a button is held. Call it with no arguments to test any button, or pass a BTN_* constant such as BTN_RIGHT to test one button.

  • buttonDown() -> bool
  • buttonDown(button) -> bool

Parameters

  • button — Logical button to test (use BTN_* constants; keyboard or gamepad).

Returns

  • bool

Examples

-- True while any button is held.
local anyHeld = buttonDown()

-- True while Right is held.
local movingRight = buttonDown(BTN_RIGHT)

buttonPressed

Return true only on the frame a button goes down. Call it with no arguments to test any button, or pass a BTN_* constant such as BTN_A to test one button.

  • buttonPressed() -> bool
  • buttonPressed(button) -> bool

Parameters

  • button — Logical button to test (use BTN_* constants; keyboard or gamepad).

Returns

  • bool

Examples

-- True on the frame any button goes down.
local anyPressed = buttonPressed()

-- True on the frame A goes down.
local jumpPressed = buttonPressed(BTN_A)