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
LuaInput.cpp
Go to the documentation of this file.
1
7
8#include <entt/locator/locator.hpp>
9#include <sol/sol.hpp>
10
14#include "galaxy/input/Keys.hpp"
17
18#include "../Lua.hpp"
19
20namespace galaxy
21{
22 void Lua::inject_input() noexcept
23 {
24 auto& lua = entt::locator<sol::state>::value();
25
26 lua.set_function("input_clipboard_set", &input::set_clipboard);
27 lua.set_function("input_clipboard_get", &input::get_clipboard);
28
29 lua.set_function("input_is_key_mod_down", &input::is_key_mod_down);
30 lua.set_function("input_is_key_down", &input::is_key_down);
31 lua.set_function("input_is_mouse_down", &input::is_mouse_down);
32 lua.set_function("input_get_cursor_pos", &input::get_cursor_pos);
33
34 auto keyboard_type = lua.new_usertype<Keyboard>("Keyboard", sol::no_constructor);
35 keyboard_type["begin_text_input"] = &Keyboard::begin_text_input;
36 keyboard_type["clear_state"] = &Keyboard::clear_state;
37 keyboard_type["end_text_input"] = &Keyboard::end_text_input;
38 keyboard_type["has_keyboard"] = &Keyboard::has_keyboard;
39 keyboard_type["has_onscreen_keyboard"] = &Keyboard::has_onscreen_keyboard;
40 keyboard_type["onscreen_keyboard_active"] = &Keyboard::onscreen_keyboard_active;
41
42 auto mouse_type = lua.new_usertype<Mouse>("Mouse", sol::no_constructor);
43 mouse_type["has_mouse"] = &Mouse::has_mouse;
44 mouse_type["hide_cursor"] = &Mouse::hide_cursor;
45 mouse_type["restore_cursor"] = &Mouse::restore_cursor;
46 mouse_type["set_cursor_custom"] = &Mouse::set_cursor_custom;
47 mouse_type["set_cursor_system"] = &Mouse::set_cursor_system;
48 mouse_type["set_mouse_grab"] = &Mouse::set_mouse_grab;
49 mouse_type["show_cursor"] = &Mouse::show_cursor;
50 mouse_type["warp_mouse"] = &Mouse::warp_mouse;
51
52 // clang-format off
53 lua.new_enum<MouseButton>("MouseButton",
54 {
55 {"UNKNOWN", MouseButton::UNKNOWN},
56 {"LEFT", MouseButton::LEFT},
57 {"MIDDLE", MouseButton::MIDDLE},
58 {"RIGHT", MouseButton::RIGHT},
59 {"SIDE_1", MouseButton::SIDE_1},
60 {"SIDE_2", MouseButton::SIDE_2}
61 });
62
63 lua.new_enum<Keys>("Keys",
64 {
65 {"KEY_UNKNOWN", Keys::KEY_UNKNOWN},
66 {"KEY_RETURN", Keys::KEY_RETURN},
67 {"KEY_ESCAPE", Keys::KEY_ESCAPE},
68 {"KEY_BACKSPACE", Keys::KEY_BACKSPACE},
69 {"KEY_TAB", Keys::KEY_TAB},
70 {"KEY_SPACE", Keys::KEY_SPACE},
71 {"KEY_EXCLAIM", Keys::KEY_EXCLAIM},
72 {"KEY_DBLAPOSTROPHE", Keys::KEY_DBLAPOSTROPHE},
73 {"KEY_HASH", Keys::KEY_HASH},
74 {"KEY_DOLLAR", Keys::KEY_DOLLAR},
75 {"KEY_PERCENT", Keys::KEY_PERCENT},
76 {"KEY_AMPERSAND", Keys::KEY_AMPERSAND},
77 {"KEY_APOSTROPHE", Keys::KEY_APOSTROPHE},
78 {"KEY_LEFTPAREN", Keys::KEY_LEFTPAREN},
79 {"KEY_RIGHTPAREN", Keys::KEY_RIGHTPAREN},
80 {"KEY_ASTERISK", Keys::KEY_ASTERISK},
81 {"KEY_PLUS", Keys::KEY_PLUS},
82 {"KEY_COMMA", Keys::KEY_COMMA},
83 {"KEY_MINUS", Keys::KEY_MINUS},
84 {"KEY_PERIOD", Keys::KEY_PERIOD},
85 {"KEY_SLASH", Keys::KEY_SLASH},
86 {"KEY_0", Keys::KEY_0},
87 {"KEY_1", Keys::KEY_1},
88 {"KEY_2", Keys::KEY_2},
89 {"KEY_3", Keys::KEY_3},
90 {"KEY_4", Keys::KEY_4},
91 {"KEY_5", Keys::KEY_5},
92 {"KEY_6", Keys::KEY_6},
93 {"KEY_7", Keys::KEY_7},
94 {"KEY_8", Keys::KEY_8},
95 {"KEY_9", Keys::KEY_9},
96 {"KEY_COLON", Keys::KEY_COLON},
97 {"KEY_SEMICOLON", Keys::KEY_SEMICOLON},
98 {"KEY_LESS", Keys::KEY_LESS},
99 {"KEY_EQUALS", Keys::KEY_EQUALS},
100 {"KEY_GREATER", Keys::KEY_GREATER},
101 {"KEY_QUESTION", Keys::KEY_QUESTION},
102 {"KEY_AT", Keys::KEY_AT},
103 {"KEY_LEFTBRACKET", Keys::KEY_LEFTBRACKET},
104 {"KEY_BACKSLASH", Keys::KEY_BACKSLASH},
105 {"KEY_RIGHTBRACKET", Keys::KEY_RIGHTBRACKET},
106 {"KEY_CARET", Keys::KEY_CARET},
107 {"KEY_UNDERSCORE", Keys::KEY_UNDERSCORE},
108 {"KEY_GRAVE", Keys::KEY_GRAVE},
109 {"KEY_A", Keys::KEY_A},
110 {"KEY_B", Keys::KEY_B},
111 {"KEY_C", Keys::KEY_C},
112 {"KEY_D", Keys::KEY_D},
113 {"KEY_E", Keys::KEY_E},
114 {"KEY_F", Keys::KEY_F},
115 {"KEY_G", Keys::KEY_G},
116 {"KEY_H", Keys::KEY_H},
117 {"KEY_I", Keys::KEY_I},
118 {"KEY_J", Keys::KEY_J},
119 {"KEY_K", Keys::KEY_K},
120 {"KEY_L", Keys::KEY_L},
121 {"KEY_M", Keys::KEY_M},
122 {"KEY_N", Keys::KEY_N},
123 {"KEY_O", Keys::KEY_O},
124 {"KEY_P", Keys::KEY_P},
125 {"KEY_Q", Keys::KEY_Q},
126 {"KEY_R", Keys::KEY_R},
127 {"KEY_S", Keys::KEY_S},
128 {"KEY_T", Keys::KEY_T},
129 {"KEY_U", Keys::KEY_U},
130 {"KEY_V", Keys::KEY_V},
131 {"KEY_W", Keys::KEY_W},
132 {"KEY_X", Keys::KEY_X},
133 {"KEY_Y", Keys::KEY_Y},
134 {"KEY_Z", Keys::KEY_Z},
135 {"KEY_LEFTBRACE", Keys::KEY_LEFTBRACE},
136 {"KEY_PIPE", Keys::KEY_PIPE},
137 {"KEY_RIGHTBRACE", Keys::KEY_RIGHTBRACE},
138 {"KEY_TILDE", Keys::KEY_TILDE},
139 {"KEY_DELETE", Keys::KEY_DELETE},
140 {"KEY_PLUSMINUS", Keys::KEY_PLUSMINUS},
141 {"KEY_CAPSLOCK", Keys::KEY_CAPSLOCK},
142 {"KEY_F1", Keys::KEY_F1},
143 {"KEY_F2", Keys::KEY_F2},
144 {"KEY_F3", Keys::KEY_F3},
145 {"KEY_F4", Keys::KEY_F4},
146 {"KEY_F5", Keys::KEY_F5},
147 {"KEY_F6", Keys::KEY_F6},
148 {"KEY_F7", Keys::KEY_F7},
149 {"KEY_F8", Keys::KEY_F8},
150 {"KEY_F9", Keys::KEY_F9},
151 {"KEY_F10", Keys::KEY_F10},
152 {"KEY_F11", Keys::KEY_F11},
153 {"KEY_F12", Keys::KEY_F12},
154 {"KEY_PRINTSCREEN", Keys::KEY_PRINTSCREEN},
155 {"KEY_SCROLLLOCK", Keys::KEY_SCROLLLOCK},
156 {"KEY_PAUSE", Keys::KEY_PAUSE},
157 {"KEY_INSERT", Keys::KEY_INSERT},
158 {"KEY_HOME", Keys::KEY_HOME},
159 {"KEY_PAGEUP", Keys::KEY_PAGEUP},
160 {"KEY_END", Keys::KEY_END},
161 {"KEY_PAGEDOWN", Keys::KEY_PAGEDOWN},
162 {"KEY_RIGHT", Keys::KEY_RIGHT},
163 {"KEY_LEFT", Keys::KEY_LEFT},
164 {"KEY_DOWN", Keys::KEY_DOWN},
165 {"KEY_UP", Keys::KEY_UP},
166 {"KEY_NUMLOCKCLEAR", Keys::KEY_NUMLOCKCLEAR},
167 {"KEY_KP_DIVIDE", Keys::KEY_KP_DIVIDE},
168 {"KEY_KP_MULTIPLY", Keys::KEY_KP_MULTIPLY},
169 {"KEY_KP_MINUS", Keys::KEY_KP_MINUS},
170 {"KEY_KP_PLUS", Keys::KEY_KP_PLUS},
171 {"KEY_KP_ENTER", Keys::KEY_KP_ENTER},
172 {"KEY_KP_1", Keys::KEY_KP_1},
173 {"KEY_KP_2", Keys::KEY_KP_2},
174 {"KEY_KP_3", Keys::KEY_KP_3},
175 {"KEY_KP_4", Keys::KEY_KP_4},
176 {"KEY_KP_5", Keys::KEY_KP_5},
177 {"KEY_KP_6", Keys::KEY_KP_6},
178 {"KEY_KP_7", Keys::KEY_KP_7},
179 {"KEY_KP_8", Keys::KEY_KP_8},
180 {"KEY_KP_9", Keys::KEY_KP_9},
181 {"KEY_KP_0", Keys::KEY_KP_0},
182 {"KEY_KP_PERIOD", Keys::KEY_KP_PERIOD},
183 {"KEY_APPLICATION", Keys::KEY_APPLICATION},
184 {"KEY_POWER", Keys::KEY_POWER},
185 {"KEY_KP_EQUALS", Keys::KEY_KP_EQUALS},
186 {"KEY_F13", Keys::KEY_F13},
187 {"KEY_F14", Keys::KEY_F14},
188 {"KEY_F15", Keys::KEY_F15},
189 {"KEY_F16", Keys::KEY_F16},
190 {"KEY_F17", Keys::KEY_F17},
191 {"KEY_F18", Keys::KEY_F18},
192 {"KEY_F19", Keys::KEY_F19},
193 {"KEY_F20", Keys::KEY_F20},
194 {"KEY_F21", Keys::KEY_F21},
195 {"KEY_F22", Keys::KEY_F22},
196 {"KEY_F23", Keys::KEY_F23},
197 {"KEY_F24", Keys::KEY_F24},
198 {"KEY_EXECUTE", Keys::KEY_EXECUTE},
199 {"KEY_HELP", Keys::KEY_HELP},
200 {"KEY_MENU", Keys::KEY_MENU},
201 {"KEY_SELECT", Keys::KEY_SELECT},
202 {"KEY_STOP", Keys::KEY_STOP},
203 {"KEY_AGAIN", Keys::KEY_AGAIN},
204 {"KEY_UNDO", Keys::KEY_UNDO},
205 {"KEY_CUT", Keys::KEY_CUT},
206 {"KEY_COPY", Keys::KEY_COPY},
207 {"KEY_PASTE", Keys::KEY_PASTE},
208 {"KEY_FIND", Keys::KEY_FIND},
209 {"KEY_MUTE", Keys::KEY_MUTE},
210 {"KEY_VOLUMEUP", Keys::KEY_VOLUMEUP},
211 {"KEY_VOLUMEDOWN", Keys::KEY_VOLUMEDOWN},
212 {"KEY_KP_COMMA", Keys::KEY_KP_COMMA},
213 {"KEY_KP_EQUALSAS400", Keys::KEY_KP_EQUALSAS400},
214 {"KEY_ALTERASE", Keys::KEY_ALTERASE},
215 {"KEY_SYSREQ", Keys::KEY_SYSREQ},
216 {"KEY_CANCEL", Keys::KEY_CANCEL},
217 {"KEY_CLEAR", Keys::KEY_CLEAR},
218 {"KEY_PRIOR", Keys::KEY_PRIOR},
219 {"KEY_RETURN2", Keys::KEY_RETURN2},
220 {"KEY_SEPARATOR", Keys::KEY_SEPARATOR},
221 {"KEY_OUT", Keys::KEY_OUT},
222 {"KEY_OPER", Keys::KEY_OPER},
223 {"KEY_CLEARAGAIN", Keys::KEY_CLEARAGAIN},
224 {"KEY_CRSEL", Keys::KEY_CRSEL},
225 {"KEY_EXSEL", Keys::KEY_EXSEL},
226 {"KEY_KP_00", Keys::KEY_KP_00},
227 {"KEY_KP_000", Keys::KEY_KP_000},
228 {"KEY_THOUSANDSSEPARATOR", Keys::KEY_THOUSANDSSEPARATOR},
229 {"KEY_DECIMALSEPARATOR", Keys::KEY_DECIMALSEPARATOR},
230 {"KEY_CURRENCYUNIT", Keys::KEY_CURRENCYUNIT},
231 {"KEY_CURRENCYSUBUNIT", Keys::KEY_CURRENCYSUBUNIT},
232 {"KEY_KP_LEFTPAREN", Keys::KEY_KP_LEFTPAREN},
233 {"KEY_KP_RIGHTPAREN", Keys::KEY_KP_RIGHTPAREN},
234 {"KEY_KP_LEFTBRACE", Keys::KEY_KP_LEFTBRACE},
235 {"KEY_KP_RIGHTBRACE", Keys::KEY_KP_RIGHTBRACE},
236 {"KEY_KP_TAB", Keys::KEY_KP_TAB},
237 {"KEY_KP_BACKSPACE", Keys::KEY_KP_BACKSPACE},
238 {"KEY_KP_A", Keys::KEY_KP_A},
239 {"KEY_KP_B", Keys::KEY_KP_B},
240 {"KEY_KP_C", Keys::KEY_KP_C},
241 {"KEY_KP_D", Keys::KEY_KP_D},
242 {"KEY_KP_E", Keys::KEY_KP_E},
243 {"KEY_KP_F", Keys::KEY_KP_F},
244 {"KEY_KP_XOR", Keys::KEY_KP_XOR},
245 {"KEY_KP_POWER", Keys::KEY_KP_POWER},
246 {"KEY_KP_PERCENT", Keys::KEY_KP_PERCENT},
247 {"KEY_KP_LESS", Keys::KEY_KP_LESS},
248 {"KEY_KP_GREATER", Keys::KEY_KP_GREATER},
249 {"KEY_KP_AMPERSAND", Keys::KEY_KP_AMPERSAND},
250 {"KEY_KP_DBLAMPERSAND", Keys::KEY_KP_DBLAMPERSAND},
251 {"KEY_KP_VERTICALBAR", Keys::KEY_KP_VERTICALBAR},
252 {"KEY_KP_DBLVERTICALBAR", Keys::KEY_KP_DBLVERTICALBAR},
253 {"KEY_KP_COLON", Keys::KEY_KP_COLON},
254 {"KEY_KP_HASH", Keys::KEY_KP_HASH},
255 {"KEY_KP_SPACE", Keys::KEY_KP_SPACE},
256 {"KEY_KP_AT", Keys::KEY_KP_AT},
257 {"KEY_KP_EXCLAM", Keys::KEY_KP_EXCLAM},
258 {"KEY_KP_MEMSTORE", Keys::KEY_KP_MEMSTORE},
259 {"KEY_KP_MEMRECALL", Keys::KEY_KP_MEMRECALL},
260 {"KEY_KP_MEMCLEAR", Keys::KEY_KP_MEMCLEAR},
261 {"KEY_KP_MEMADD", Keys::KEY_KP_MEMADD},
262 {"KEY_KP_MEMSUBTRACT", Keys::KEY_KP_MEMSUBTRACT},
263 {"KEY_KP_MEMMULTIPLY", Keys::KEY_KP_MEMMULTIPLY},
264 {"KEY_KP_MEMDIVIDE", Keys::KEY_KP_MEMDIVIDE},
265 {"KEY_KP_PLUSMINUS", Keys::KEY_KP_PLUSMINUS},
266 {"KEY_KP_CLEAR", Keys::KEY_KP_CLEAR},
267 {"KEY_KP_CLEARENTRY", Keys::KEY_KP_CLEARENTRY},
268 {"KEY_KP_BINARY", Keys::KEY_KP_BINARY},
269 {"KEY_KP_OCTAL", Keys::KEY_KP_OCTAL},
270 {"KEY_KP_DECIMAL", Keys::KEY_KP_DECIMAL},
271 {"KEY_KP_HEXADECIMAL", Keys::KEY_KP_HEXADECIMAL},
272 {"KEY_LCTRL", Keys::KEY_LCTRL},
273 {"KEY_LSHIFT", Keys::KEY_LSHIFT},
274 {"KEY_LALT", Keys::KEY_LALT},
275 {"KEY_LGUI", Keys::KEY_LGUI},
276 {"KEY_RCTRL", Keys::KEY_RCTRL},
277 {"KEY_RSHIFT", Keys::KEY_RSHIFT},
278 {"KEY_RALT", Keys::KEY_RALT},
279 {"KEY_RGUI", Keys::KEY_RGUI},
280 {"KEY_MODE", Keys::KEY_MODE},
281 {"KEY_SLEEP", Keys::KEY_SLEEP},
282 {"KEY_WAKE", Keys::KEY_WAKE},
283 {"KEY_CHANNEL_INCREMENT", Keys::KEY_CHANNEL_INCREMENT},
284 {"KEY_CHANNEL_DECREMENT", Keys::KEY_CHANNEL_DECREMENT},
285 {"KEY_MEDIA_PLAY", Keys::KEY_MEDIA_PLAY},
286 {"KEY_MEDIA_PAUSE", Keys::KEY_MEDIA_PAUSE},
287 {"KEY_MEDIA_RECORD", Keys::KEY_MEDIA_RECORD},
288 {"KEY_MEDIA_FAST_FORWARD", Keys::KEY_MEDIA_FAST_FORWARD},
289 {"KEY_MEDIA_REWIND", Keys::KEY_MEDIA_REWIND},
290 {"KEY_MEDIA_NEXT_TRACK", Keys::KEY_MEDIA_NEXT_TRACK},
291 {"KEY_MEDIA_PREVIOUS_TRACK", Keys::KEY_MEDIA_PREVIOUS_TRACK},
292 {"KEY_MEDIA_STOP", Keys::KEY_MEDIA_STOP},
293 {"KEY_MEDIA_EJECT", Keys::KEY_MEDIA_EJECT},
294 {"KEY_MEDIA_PLAY_PAUSE", Keys::KEY_MEDIA_PLAY_PAUSE},
295 {"KEY_MEDIA_SELECT", Keys::KEY_MEDIA_SELECT},
296 {"KEY_AC_NEW", Keys::KEY_AC_NEW},
297 {"KEY_AC_OPEN", Keys::KEY_AC_OPEN},
298 {"KEY_AC_CLOSE", Keys::KEY_AC_CLOSE},
299 {"KEY_AC_EXIT", Keys::KEY_AC_EXIT},
300 {"KEY_AC_SAVE", Keys::KEY_AC_SAVE},
301 {"KEY_AC_PRINT", Keys::KEY_AC_PRINT},
302 {"KEY_AC_PROPERTIES", Keys::KEY_AC_PROPERTIES},
303 {"KEY_AC_SEARCH", Keys::KEY_AC_SEARCH},
304 {"KEY_AC_HOME", Keys::KEY_AC_HOME},
305 {"KEY_AC_BACK", Keys::KEY_AC_BACK},
306 {"KEY_AC_FORWARD", Keys::KEY_AC_FORWARD},
307 {"KEY_AC_STOP", Keys::KEY_AC_STOP},
308 {"KEY_AC_REFRESH", Keys::KEY_AC_REFRESH},
309 {"KEY_AC_BOOKMARKS", Keys::KEY_AC_BOOKMARKS},
310 {"KEY_SOFTLEFT", Keys::KEY_SOFTLEFT},
311 {"KEY_SOFTRIGHT", Keys::KEY_SOFTRIGHT},
312 {"KEY_CALL", Keys::KEY_CALL},
313 {"KEY_ENDCALL", Keys::KEY_ENDCALL},
314 {"KEY_LEFT_TAB", Keys::KEY_LEFT_TAB},
315 {"KEY_LEVEL5_SHIFT", Keys::KEY_LEVEL5_SHIFT},
316 {"KEY_MULTI_KEY_COMPOSE", Keys::KEY_MULTI_KEY_COMPOSE},
317 {"KEY_LMETA", Keys::KEY_LMETA},
318 {"KEY_RMETA", Keys::KEY_RMETA},
319 {"KEY_LHYPER", Keys::KEY_LHYPER},
320 {"KEY_RHYPER", Keys::KEY_RHYPER}
321 });
322
323 lua.new_enum<KeyMods>("KeyMods",
324 {
325 {"MOD_NONE", KeyMods::MOD_NONE},
326 {"MOD_LSHIFT", KeyMods::MOD_LSHIFT},
327 {"MOD_RSHIFT", KeyMods::MOD_RSHIFT},
328 {"MOD_LEVEL5", KeyMods::MOD_LEVEL5},
329 {"MOD_LCTRL", KeyMods::MOD_LCTRL},
330 {"MOD_RCTRL", KeyMods::MOD_RCTRL},
331 {"MOD_LALT", KeyMods::MOD_LALT},
332 {"MOD_RALT", KeyMods::MOD_RALT},
333 {"MOD_LGUI", KeyMods::MOD_LGUI},
334 {"MOD_RGUI", KeyMods::MOD_RGUI},
335 {"MOD_NUM", KeyMods::MOD_NUM},
336 {"MOD_CAPS", KeyMods::MOD_CAPS},
337 {"MOD_MODE", KeyMods::MOD_MODE},
338 {"MOD_SCROLL", KeyMods::MOD_SCROLL},
339 {"MOD_CTRL", KeyMods::MOD_CTRL},
340 {"MOD_SHIFT", KeyMods::MOD_SHIFT},
341 {"MOD_ALT", KeyMods::MOD_ALT},
342 {"MOD_GUI", KeyMods::MOD_GUI}
343 });
344 // clang-format on
345 }
346} // namespace galaxy
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
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
static void inject_input() noexcept
Injects input handling into Lua.
Definition LuaInput.cpp:22
Physical mouse device and state management.
Definition Mouse.hpp:22
void set_cursor_system(const SDL_SystemCursor cursor) noexcept
Set cursor to a system cursor.
Definition Mouse.cpp:54
void hide_cursor() const noexcept
Hide cursor.
Definition Mouse.cpp:49
void restore_cursor() noexcept
Set the cursor back to default.
Definition Mouse.cpp:107
void set_mouse_grab(const bool grabbed) const noexcept
Toggle mouse grab.
Definition Mouse.cpp:34
void show_cursor() const noexcept
Show cursor.
Definition Mouse.cpp:44
bool has_mouse() const noexcept
Check if there is a mouse connected.
Definition Mouse.cpp:29
void set_cursor_custom(const std::string &cursor, const glm::ivec2 &hotspot) noexcept
Set custom cursor texture.
Definition Mouse.cpp:69
void warp_mouse(const float x, const float y) const noexcept
Move the mouse cursor to the given position within the window.
Definition Mouse.cpp:39
void set_clipboard(const std::string &contents) noexcept
Set clipboard contents.
Definition Clipboard.cpp:16
glm::vec2 get_cursor_pos() noexcept
Get current cursor position.
Definition Input.cpp:34
bool is_key_mod_down(const KeyMods modifier) noexcept
See if a key mod is being held down.
Definition Input.cpp:16
bool is_key_down(const Keys key) noexcept
See if a key is being held down.
Definition Input.cpp:22
bool is_mouse_down(const MouseButton btn) noexcept
Check if a mouse button was pressed.
Definition Input.cpp:28
std::string get_clipboard() noexcept
Get clipboard contents.
Definition Clipboard.cpp:21
Animated.cpp galaxy.
Definition Animated.cpp:16
Keys
Enum class representing keys.
Definition Keys.hpp:19
@ KEY_THOUSANDSSEPARATOR
@ KEY_MEDIA_PREVIOUS_TRACK
@ KEY_MEDIA_FAST_FORWARD
KeyMods
Enum class for key modifiers.
Definition Keys.hpp:282
MouseButton
Enum class representing mouse buttons.