minor refactor

This commit is contained in:
MihailRis 2024-03-20 09:10:35 +03:00
parent 4b25cc38d9
commit 1b1f11e0b8
6 changed files with 83 additions and 86 deletions

View file

@ -3,9 +3,7 @@
#include <string>
/**
* @brief Represents glfw3 keycode values.
*/
/// @brief Represents glfw3 keycode values.
enum class keycode : int {
ENTER = 257,
TAB = 258,
@ -88,21 +86,25 @@ enum class keycode : int {
};
/**
* @brief Represents glfw3 mouse button IDs.
* @details There is a subset of glfw3 mouse button IDs.
*/
/// @brief Represents glfw3 mouse button IDs.
/// @details There is a subset of glfw3 mouse button IDs.
enum class mousecode : int {
BUTTON_1 = 0, // Left mouse button
BUTTON_2 = 1, // Right mouse button
BUTTON_3 = 2, // Middle mouse button
};
inline mousecode MOUSECODES_ALL[] {
mousecode::BUTTON_1,
mousecode::BUTTON_2,
mousecode::BUTTON_3
};
namespace input_util {
// @return Key label by keycode
/// @return Key label by keycode
std::string to_string(keycode code);
// @return Mouse button label by keycode
/// @return Mouse button label by keycode
std::string to_string(mousecode code);
}
@ -143,4 +145,4 @@ struct Binding {
};
#endif // WINDOW_INPUT_H_
#endif // WINDOW_INPUT_H_