Files
basic1/lib/input_event.h
Adolfo Reyna 2a472fc29f Add frame tick system for continuous animation
- Added INPUT_FRAME_TICK event type to input_event.h
- Added wants_frame_updates() virtual method to Game base class
- Implemented frame tick logic in main loop (basic1.cpp and emulator/main.cpp)
- Added Lua bindings: game.set_frame_updates(bool) and INPUT.FRAME_TICK
- Updated LuaGame to support frame updates via registry flag
- Updated ball.lua to use continuous frame updates for smooth animation
- Both hardware and emulator now support continuous animation for physics/games
2026-02-07 13:20:10 -05:00

36 lines
983 B
C

// ============================================================================
// INPUT EVENT HEADER
// ============================================================================
// Shared input event structures used by InputManager and Game classes
// Extracted from basic1.cpp for modular game architecture
#ifndef INPUT_EVENT_H
#define INPUT_EVENT_H
#include <stdint.h>
// Input event types
enum InputType {
INPUT_NONE = 0,
INPUT_TOUCH_DOWN,
INPUT_TOUCH_MOVE,
INPUT_TOUCH_UP,
INPUT_BUTTON_0,
INPUT_BUTTON_1,
INPUT_GESTURE,
INPUT_FRAME_TICK // Sent every frame for animation/continuous updates
};
// Unified input event structure
struct InputEvent {
InputType type;
int16_t x;
int16_t y;
uint8_t gesture_code; // For gesture events
uint8_t button_id; // For button events
uint8_t pressure; // Touch pressure/weight
bool valid; // Set to true if event is valid
};
#endif // INPUT_EVENT_H