custom keycodes
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
#ifndef INPUT_HPP
|
||||
#define INPUT_HPP
|
||||
|
||||
#include "open_engine/core.hpp"
|
||||
#include "open_engine/input/mouse_codes.hpp"
|
||||
#include "open_engine/ref_scope.hpp"
|
||||
#include "open_engine/input/keycodes.hpp"
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
|
||||
#define MAX_AXIS 10
|
||||
@@ -15,9 +18,9 @@ namespace OpenEngine {
|
||||
Input(const Input&) = delete;
|
||||
Input& operator=(const Input&) = delete;
|
||||
|
||||
inline static bool IsKeyPressed(int keycode) { return instance->IsKeyPressedImpl(keycode); };
|
||||
inline static bool IsKeyPressed(KeyCode keycode) { return instance->IsKeyPressedImpl(keycode); };
|
||||
|
||||
inline static bool IsMouseButtonPressed(int button) { return instance->IsMouseButtonPressedImpl(button); };
|
||||
inline static bool IsMouseButtonPressed(MouseCode button) { return instance->IsMouseButtonPressedImpl(button); };
|
||||
|
||||
inline static std::pair<float, float> GetMousePosition() { return instance->GetMousePositionImpl(); };
|
||||
inline static bool GetMouseX() { return instance->GetMouseXImpl(); };
|
||||
@@ -35,9 +38,9 @@ namespace OpenEngine {
|
||||
protected:
|
||||
Input() = default;
|
||||
|
||||
virtual bool IsKeyPressedImpl(int keycode) = 0;
|
||||
virtual bool IsKeyPressedImpl(KeyCode keycode) = 0;
|
||||
|
||||
virtual bool IsMouseButtonPressedImpl(int button) = 0;
|
||||
virtual bool IsMouseButtonPressedImpl(MouseCode button) = 0;
|
||||
|
||||
virtual std::pair<float, float> GetMousePositionImpl() = 0;
|
||||
virtual float GetMouseXImpl() = 0;
|
||||
|
||||
Reference in New Issue
Block a user