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 friend class Window;
25
26 public:
30 ~Keyboard() noexcept;
31
41 void begin_text_input(const SDL_TextInputType input_type, const SDL_Capitalization capitals, const bool multiline) const noexcept;
42
46 void end_text_input() const noexcept;
47
51 void clear_state() const noexcept;
52
58 [[nodiscard]]
59 bool has_keyboard() const noexcept;
60
66 [[nodiscard]]
67 bool has_onscreen_keyboard() const noexcept;
68
74 [[nodiscard]]
75 bool onscreen_keyboard_active() const noexcept;
76
77 private:
81 Keyboard() noexcept;
82
86 Keyboard(Keyboard&&) = delete;
87
91 Keyboard& operator=(Keyboard&&) = delete;
92
96 Keyboard(const Keyboard&) = delete;
97
101 Keyboard& operator=(const Keyboard&) = delete;
102
103 private:
104 };
105} // namespace galaxy
106
107/*
108* ///
111 bool m_text_input_enabled;
112
113
120 void enable_sticky_keys() const;
121
125 void disable_sticky_keys() const;
126
132 [[nodiscard]]
133 bool is_text_input_enabled() const;
134
142 [[nodiscard]]
143 int get_scancode(const input::Keys key) const;
144
152 [[nodiscard]]
153 std::string get_key_name(const input::Keys key) const;
154
162 [[nodiscard]]
163 std::string get_scancode_name(const int scancode) const;*/
164
165#endif
Physical keyboard device and state management.
Definition Keyboard.hpp:23
void clear_state() const noexcept
Will clear any existing keyboard state.
Definition Keyboard.cpp:40
void end_text_input() const noexcept
Disable text input.
Definition Keyboard.cpp:35
bool onscreen_keyboard_active() const noexcept
Check if onscreen keyboard is shown.
Definition Keyboard.cpp:55
~Keyboard() noexcept
Destructor.
Definition Keyboard.cpp:16
bool has_keyboard() const noexcept
Check if there is a keyboard connected.
Definition Keyboard.cpp:45
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:20
bool has_onscreen_keyboard() const noexcept
Check if an onscreen keyboard is supported.
Definition Keyboard.cpp:50
Binds the mouse to the window.
RAII Window. Handles events, input & display.
Definition Window.hpp:33
Animated.cpp galaxy.
Definition Animated.cpp:16