| 1 | #ifndef INPUT_H |
| 2 | #define INPUT_H |
| 3 |
|
| 4 | #include <stdint.h> |
| 5 |
|
| 6 | enum { |
| 7 | BTN_UP = 1 << 0, BTN_DOWN = 1 << 1, BTN_LEFT = 1 << 2, BTN_RIGHT = 1 << 3, |
| 8 | BTN_CROSS = 1 << 4, BTN_CIRCLE = 1 << 5, BTN_SQUARE = 1 << 6, BTN_TRIANGLE = 1 << 7, |
| 9 | BTN_L1 = 1 << 8, BTN_R1 = 1 << 9, BTN_L2 = 1 << 10, BTN_R2 = 1 << 11, |
| 10 | BTN_START = 1 << 12, BTN_SELECT = 1 << 13, BTN_L3 = 1 << 14, BTN_R3 = 1 << 15, |
| 11 | }; |
| 12 |
|
| 13 | // the backend: buttons held now on any pad (the left stick counts as the d-pad) |
| 14 | uint32_t plat_input_held(void); |
| 15 |
|
| 16 | void input_update(void); |
| 17 | // pressed this frame; the d-pad and L1/R1 repeat while held |
| 18 | uint32_t input_pressed(void); |
| 19 | uint32_t input_held(void); |
| 20 | // pressed this frame by a real press, not auto-repeat: for moves that leave an area |
| 21 | // (into the bar or the sidebar), so holding a direction stops at the edge |
| 22 | uint32_t input_fresh(void); |
| 23 |
|
| 24 | #endif |