diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2023-11-08 10:34:08 -0500 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2023-11-08 11:09:15 -0500 |
| commit | 2e2d668b6a6989a1471cdc7854d387ba774c19d3 (patch) | |
| tree | 624c7b260ff4994396e1d108aee5c063681ab6ad /src/player-input.hpp | |
| parent | 5fa4f2c31d79adb83e438ad802c4bf176f10a535 (diff) | |
input events are queryable
Diffstat (limited to 'src/player-input.hpp')
| -rw-r--r-- | src/player-input.hpp | 14 |
1 files changed, 8 insertions, 6 deletions
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(); |
