From 2e2d668b6a6989a1471cdc7854d387ba774c19d3 Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Wed, 8 Nov 2023 10:34:08 -0500 Subject: input events are queryable --- src/player-input.hpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/player-input.hpp') diff --git a/src/player-input.hpp b/src/player-input.hpp index baa4327..a5e64be 100644 --- a/src/player-input.hpp +++ b/src/player-input.hpp @@ -5,12 +5,12 @@ #include "game-type-defs.hpp" #include "macros.hpp" -TypeSafeInt_H(InputEventHash, int16_t, 255); -TypeSafeInt_H(InputEventType, int16_t, 255); -TypeSafeInt_H(InputCursorEntered, int16_t, 255); -TypeSafeInt_H(InputKeyboardKeyAction, int16_t, 255); -TypeSafeInt_H(InputMouseButtonAction, int16_t, 255); -TypeSafeInt_H(InputWindowFocused, int16_t, 255); +TypeSafeInt_H(InputEventHash, int16_t, 0x0FFF); +TypeSafeInt_H(InputEventType, int16_t, 0x0FFF); +TypeSafeInt_H(InputCursorEntered, int16_t, 0x0FFF); +TypeSafeInt_H(InputKeyboardKeyAction, int16_t, 0x0FFF); +TypeSafeInt_H(InputMouseButtonAction, int16_t, 0x0FFF); +TypeSafeInt_H(InputWindowFocused, int16_t, 0x0FFF); const InputEventType PKE_INPUT_EVENT_TYPE_CURSOR_ENTER = InputEventType{0}; const InputEventType PKE_INPUT_EVENT_TYPE_CURSOR_POS = InputEventType{1}; @@ -48,9 +48,11 @@ struct PkeInputEvent { int32_t button; int32_t scanCode; int32_t mods; + uint64_t tickCount; }; void PkeInput_Tick(double delta); +bool PkeInput_Query(const PkeInputEvent &mask); void PkeInput_Init(); void PkeInput_Teardown(); -- cgit v1.2.3