crocparty/sys/sys_input.h
2024-02-27 21:07:15 -08:00

33 lines
788 B
C

#ifndef SYS_INPUT_H
#define SYS_INPUT_H
/**
* Update the state of every button. Each button's btnp state depends
* on how long it's been down, and calling this function adds one frame.
*
* Usually this is called by sys_update(), at the start of frame.
*/
void sys_input_update();
/**
* Resets the input state -- all buttons have been held for 0 frames.
*
* If the buttons are held next frame, this will lead to a btnp().
*
* There's rarely any reason for user code to call this.
*/
void sys_input_reset();
/**
* Return whether a button is down.
*/
bool sys_btn(DeviceButton button);
/**
* Return whether a button was just pressed.
*
* Repeats after 30 frames, returning true every 8 frames after that.
*/
bool sys_btnp(DeviceButton button);
#endif // SYS_INPUT_H