galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
Keyboard.hpp
Go to the documentation of this file.
1
7
8#ifndef GALAXY_INPUT_KEYBOARD_HPP_
9#define GALAXY_INPUT_KEYBOARD_HPP_
10
11#include <string>
12
13#include <SDL3/SDL_keyboard.h>
14
16
17namespace galaxy
18{
22 class Keyboard final : public WindowBindable
23 {
24 public:
28 Keyboard() noexcept;
29
33 ~Keyboard() noexcept;
34
44 void begin_text_input(const SDL_TextInputType input_type, const SDL_Capitalization capitals, const bool multiline) const noexcept;
45
49 void end_text_input() const noexcept;
50
54 void clear_state() const noexcept;
55
61 [[nodiscard]]
62 bool has_keyboard() const noexcept;
63
69 [[nodiscard]]
70 bool has_onscreen_keyboard() const noexcept;
71
77 [[nodiscard]]
78 bool onscreen_keyboard_active() const noexcept;
79
80 private:
84 Keyboard(Keyboard&&) = delete;
85
90
94 Keyboard(const Keyboard&) = delete;
95
99 Keyboard& operator=(const Keyboard&) = delete;
100 };
101} // namespace galaxy
102
103/*
104* ///
107 bool m_text_input_enabled;
108
109
116 void enable_sticky_keys() const;
117
121 void disable_sticky_keys() const;
122
128 [[nodiscard]]
129 bool is_text_input_enabled() const;
130
138 [[nodiscard]]
139 int get_scancode(const input::Keys key) const;
140
148 [[nodiscard]]
149 std::string get_key_name(const input::Keys key) const;
150
158 [[nodiscard]]
159 std::string get_scancode_name(const int scancode) const;*/
160
161#endif
Physical keyboard device and state management.
Definition Keyboard.hpp:23
Keyboard() noexcept
Constructor.
Definition Keyboard.cpp:12
void clear_state() const noexcept
Will clear any existing keyboard state.
Definition Keyboard.cpp:41
void end_text_input() const noexcept
Disable text input.
Definition Keyboard.cpp:36
bool onscreen_keyboard_active() const noexcept
Check if onscreen keyboard is shown.
Definition Keyboard.cpp:56
Keyboard & operator=(const Keyboard &)=delete
Copy assignment operator.
Keyboard(Keyboard &&)=delete
Move constructor.
~Keyboard() noexcept
Destructor.
Definition Keyboard.cpp:17
Keyboard & operator=(Keyboard &&)=delete
Move assignment operator.
bool has_keyboard() const noexcept
Check if there is a keyboard connected.
Definition Keyboard.cpp:46
void begin_text_input(const SDL_TextInputType input_type, const SDL_Capitalization capitals, const bool multiline) const noexcept
Enable window to begin processing text input.
Definition Keyboard.cpp:21
Keyboard(const Keyboard &)=delete
Copy constructor.
bool has_onscreen_keyboard() const noexcept
Check if an onscreen keyboard is supported.
Definition Keyboard.cpp:51
Allows you to bind a base class to the window.
Application.hpp galaxy.