LkEngine 0.1.2
 
Loading...
Searching...
No Matches
Keyboard.h
1#pragma once
2
5#include "LkEngine/Core/LObject/ObjectPtr.h"
6#include "LkEngine/Core/Delegate/Delegate.h"
7#include "LkEngine/Core/Input/Keycodes.h"
8
9
10namespace LkEngine {
11
15 struct FKeyData
16 {
17 EKey Key{};
18 EKeyState State = EKeyState::None;
19 EKeyState OldState = EKeyState::None;
20 int RepeatCount = 0;
21 };
22
23 class LKeyboard : public LObject
24 {
25 public:
26 LK_DECLARE_MULTICAST_DELEGATE(FOnKeyPressed, const FKeyData&);
27 LK_DECLARE_MULTICAST_DELEGATE(FOnKeyReleased, const FKeyData&);
28 LK_DECLARE_MULTICAST_DELEGATE(FOnKeyHeld, const FKeyData&);
29 public:
30 LKeyboard();
31
32 void Initialize();
33
34 static bool IsKeyPressed(const EKey Key);
35
36 static LKeyboard& Get();
37
38 public:
39 static FOnKeyPressed OnKeyPressed; /* TODO: Might remove this as static. */
40 static FOnKeyReleased OnKeyReleased; /* TODO: Might remove this as static. */
41 static FOnKeyHeld OnKeyHeld; /* TODO: Might remove this as static. */
42 private:
44 };
45}
Core macros used by the entire engine.
LObject implementation.
Definition Keyboard.h:24
void Initialize()
Initialize object.
Definition Keyboard.cpp:19
Definition Object.h:46
#define LCLASS(Class)
Definition CoreMacros.h:226
Definition Asset.h:11
EKeyState
Definition Keycodes.h:114
EKey
Definition Keycodes.h:17
Definition Keyboard.h:16