SleakEngine 1.0.0
C++23 multi-backend game engine
Loading...
Searching...
No Matches
Keyboard.hpp
Go to the documentation of this file.
1#ifndef _KEYBOARD_HPP_
2#define _KEYBOARD_HPP_
3
4#include <bitset>
5#include <functional>
6
7#include <Input/KeyCodes.hpp>
8
9namespace Sleak {
10 namespace Input {
11/// Static keyboard state queried by key code; Window feeds it raw key events.
12/// @ingroup input
13class Keyboard {
14 friend class Window;
15 public:
16
17 Keyboard() = default;
18 ~Keyboard() = default;
19
20 bool Initialize();
21 void Shutdown();
22
23 // Queries key states
24 /// True on the frame key transitions from up to down.
25 static bool IsKeyPressed(KEY_CODE key);
26 /// True while key is held down, including the initial press frame.
27 static bool IsKeyHold(KEY_CODE key);
28 /// True on the frame key transitions from down to up.
29 static bool IsKeyReleased(KEY_CODE key);
30
31 };
32}
33}
34
35#endif
static bool IsKeyHold(KEY_CODE key)
True while key is held down, including the initial press frame.
static bool IsKeyPressed(KEY_CODE key)
True on the frame key transitions from up to down.
friend class Window
Definition Keyboard.hpp:14
static bool IsKeyReleased(KEY_CODE key)
True on the frame key transitions from down to up.
Key and mouse-button code enumerations plus their name lookups.
Root namespace for everything the engine exposes.
Definition Camera.hpp:10