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
9
namespace
Sleak
{
10
namespace
Input
{
11
/// Static keyboard state queried by key code; Window feeds it raw key events.
12
/// @ingroup input
13
class
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
KeyCodes.hpp
Sleak::Input::Keyboard::IsKeyHold
static bool IsKeyHold(KEY_CODE key)
True while key is held down, including the initial press frame.
Sleak::Input::Keyboard::Initialize
bool Initialize()
Sleak::Input::Keyboard::IsKeyPressed
static bool IsKeyPressed(KEY_CODE key)
True on the frame key transitions from up to down.
Sleak::Input::Keyboard::Window
friend class Window
Definition
Keyboard.hpp:14
Sleak::Input::Keyboard::~Keyboard
~Keyboard()=default
Sleak::Input::Keyboard::Keyboard
Keyboard()=default
Sleak::Input::Keyboard::Shutdown
void Shutdown()
Sleak::Input::Keyboard::IsKeyReleased
static bool IsKeyReleased(KEY_CODE key)
True on the frame key transitions from down to up.
Sleak::Input::KEY_CODE
KEY_CODE
Definition
KeyCodes.hpp:29
Sleak::Input
Key and mouse-button code enumerations plus their name lookups.
Definition
InputAction.hpp:9
Sleak
Root namespace for everything the engine exposes.
Definition
Camera.hpp:10
include
public
Input
Keyboard.hpp
Generated on
for SleakEngine by
1.16.1