MayaFlux 0.2.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
KeyMapping.hpp
Go to the documentation of this file.
1#pragma once
2
4
5namespace MayaFlux::Core {
6
7/**
8 * @brief Convert a GLFW key code to MayaFlux Keys enum.
9 *
10 * GLFW key codes directly map to our Keys enum values (by design),
11 * so this is a straightforward type-safe cast.
12 *
13 * @param glfw_key GLFW key code (from GLFW_KEY_* constants)
14 * @return The corresponding IO::Keys value
15 *
16 * @note Unknown/unmapped GLFW keys are converted to Keys::Unknown
17 */
18MAYAFLUX_API IO::Keys from_glfw_key(int glfw_key) noexcept;
19
20/**
21 * @brief Convert a MayaFlux Keys enum to GLFW key code.
22 *
23 * Reverse mapping from our Keys enum back to GLFW key codes.
24 * Used when you need to interface with GLFW or serialize key bindings.
25 *
26 * @param key The IO::Keys value to convert
27 * @return The corresponding GLFW key code
28 */
29MAYAFLUX_API int to_glfw_key(IO::Keys key) noexcept;
30
31/**
32 * @brief Check if a GLFW key code is valid/supported.
33 *
34 * @param glfw_key GLFW key code to validate
35 * @return True if the key is a recognized MayaFlux key, false otherwise
36 */
37MAYAFLUX_API bool is_valid_glfw_key(int glfw_key) noexcept;
38
39} // namespace MayaFlux::Core
int to_glfw_key(IO::Keys key) noexcept
Convert a MayaFlux Keys enum to GLFW key code.
IO::Keys from_glfw_key(int glfw_key) noexcept
Convert a GLFW key code to MayaFlux Keys enum.
Definition KeyMapping.cpp:5
bool is_valid_glfw_key(int glfw_key) noexcept
Check if a GLFW key code is valid/supported.