Skip to content
Kyuchumimo edited this page Apr 24, 2024 · 9 revisions

🕹️ This function by default only supports 1P ID input

  • btnp([id], [hold][NOT SUPPORTED], [period][NOT SUPPORTED]) -> is_pressed
  • btnp() -> GAMEPADS data

Parameters

  • id : the id (0..7) of the button we wish to interrogate
  • hold : the time (in ticks) the button must be pressed before re-checking
  • period : the amount of time (in ticks) after hold before this function will return True again.

Returns

  • is_pressed : button is pressed now but not in previous frame (true/false)
  • GAMEPADS data : 8-bit value that represents a bitwise AND of the current and prior state of GAMEPADS data. Ie, a bitmask of buttons that were released in the prior frame yet currently held.

Description

This function allows you to read the status of one of the buttons. It returns True only if the key has been pressed since the last frame.

Clone this wiki locally