2#ifdef StevEngine_INPUTS
3#include "main/EventSystem.hpp"
4#include "main/EngineEvents.hpp"
5#include "utilities/Vector2.hpp"
8#include <SDL_keycode.h>
20 typedef int32_t Button;
24 enum MouseButton : Button {
25 LEFT = -SDL_BUTTON_LEFT,
26 RIGHT = -SDL_BUTTON_RIGHT,
27 MIDDLE = -SDL_BUTTON_MIDDLE,
28 EXTRA1 = -SDL_BUTTON_X1,
29 EXTRA2 = -SDL_BUTTON_X2,
30 SCROLL_UP = EXTRA2 - 1,
31 SCROLL_DOWN = SCROLL_UP - 1,
80 #ifdef StevEngine_SHOW_WINDOW
87 std::unordered_map<Button, bool> inputMap;
90 double mouseWheelDelta;
92 void HandleSDLEvent(
const SDLEvent event);
93 void Update(
double deltaTime);
94 void ResetMouseDelta();
112 const std::string
GetEventType()
const override {
return GetStaticEventType(); };
113 static const std::string GetStaticEventType() {
return "InputKeyDownEvent"; }
127 const std::string
GetEventType()
const override {
return GetStaticEventType(); };
128 static const std::string GetStaticEventType() {
return "InputKeyUpEvent"; }
145 const std::string
GetEventType()
const override {
return GetStaticEventType(); };
146 static const std::string GetStaticEventType() {
return "InputMouseMoveEvent"; }
161 const std::string
GetEventType()
const override {
return GetStaticEventType(); };
162 static const std::string GetStaticEventType() {
return "InputMouseWheelEvent"; }
176 const std::string
GetEventType()
const override {
return GetStaticEventType(); };
177 static const std::string GetStaticEventType() {
return "InputMouseButtonDownEvent"; }
191 const std::string
GetEventType()
const override {
return GetStaticEventType(); };
192 static const std::string GetStaticEventType() {
return "InputMouseButtonUpEvent"; }
Manages event subscriptions and publishing.
Definition EventSystem.hpp:74
Base class for all engine events.
Definition EventSystem.hpp:12
Event containing raw SDL event.
Definition EngineEvents.hpp:67
2D vector class
Definition Vector2.hpp:13