Keyboard event-based input is working for keydown and keyup

This commit is contained in:
2022-11-05 17:54:45 +01:00
parent 0c145b4e5b
commit 2439c3d7b9
9 changed files with 266 additions and 54 deletions

View File

@@ -4,6 +4,9 @@
#include "engine_node.h"
#include "interpreter.h"
#include "literal_array.h"
#include "literal_dictionary.h"
#include <SDL2/SDL.h>
#include <sys/time.h>
@@ -24,6 +27,13 @@ typedef struct _engine {
SDL_Renderer* renderer;
int screenWidth;
int screenHeight;
//input syms mapped to events
LiteralArray keyDownEvents; //list of events that occurred this frame
LiteralDictionary symKeyDownEvents; //keysym -> event names
LiteralArray keyUpEvents; //list of events that occurred this frame
LiteralDictionary symKeyUpEvents; //keysym -> event names
} Engine;
//extern singleton