Files
Seele/src/Engine/System/KeyboardInput.h
T

32 lines
988 B
C++
Raw Normal View History

2023-11-17 22:31:26 +01:00
#pragma once
#include "Component/KeyboardInput.h"
2024-06-09 12:20:04 +02:00
#include "ComponentSystem.h"
2023-11-17 22:31:26 +01:00
2024-06-09 12:20:04 +02:00
namespace Seele {
namespace System {
class KeyboardInput : public ComponentSystem<Component::KeyboardInput> {
public:
2023-11-17 22:31:26 +01:00
KeyboardInput(PScene scene);
virtual ~KeyboardInput();
virtual void update(Component::KeyboardInput& input) override;
void keyCallback(KeyCode code, InputAction action, KeyModifier modifier);
void mouseCallback(double xPos, double yPos);
void mouseButtonCallback(MouseButton button, InputAction action, KeyModifier modifier);
void scrollCallback(double xScroll, double yScroll);
2024-06-09 12:20:04 +02:00
private:
2023-11-17 22:31:26 +01:00
Seele::StaticArray<bool, (size_t)KeyCode::KEY_LAST> keys;
bool mouse1 = false;
bool mouse2 = false;
float lastMouseX = 0;
float lastMouseY = 0;
float mouseX = 0;
float mouseY = 0;
float deltaX = 0;
float deltaY = 0;
float scrollX = 0;
float scrollY = 0;
2023-11-17 22:31:26 +01:00
};
DEFINE_REF(KeyboardInput)
2024-06-09 12:20:04 +02:00
} // namespace System
} // namespace Seele