8 constexpr std::array<std::pair<char, Keys>, 10> char_to_keys = { {
24 for (
const auto& [ch, key] : char_to_keys) {
29 if (c >=
'0' && c <=
'9') {
30 return static_cast<Keys>(
static_cast<int>(c));
32 if (c >=
'A' && c <=
'Z') {
33 return static_cast<Keys>(
static_cast<int>(c));
35 if (c >=
'a' && c <=
'z') {
36 return static_cast<Keys>(
static_cast<int>(c) - 32);
48 if (str.length() == 1) {
52 return Reflect::string_to_enum_case_insensitive<Keys>(str);
67 int k =
static_cast<int>(key);
68 return k >= 32 && k <= 126;
78 int k =
static_cast<int>(key);
79 return k >= 290 && k <= 314;
84 int k =
static_cast<int>(key);
85 return k >= 320 && k <= 336;
90 return Reflect::get_enum_names_lowercase<Keys>();
95 return Reflect::get_enum_names<Keys>();
100 return Reflect::get_enum_values<Keys>();
105 return Reflect::enum_count<Keys>();
bool is_modifier(Keys key) noexcept
Checks if a key is a modifier key (e.g., Shift, Ctrl, Alt).
std::vector< std::string > all_key_names_lowercase() noexcept
Returns a vector of all key names in lowercase.
size_t key_count() noexcept
Returns the total number of keys.
bool is_printable(Keys key) noexcept
Checks if a key is a printable character.
std::string to_lowercase_string(Keys key) noexcept
Converts a Keys enum value to its lowercase string representation.
std::optional< Keys > from_char(char c) noexcept
Converts a character to the corresponding Keys enum value.
bool is_function_key(Keys key) noexcept
Checks if a key is a function key (e.g., F1-F25).
std::optional< Keys > from_string(std::string_view str) noexcept
Converts a string to the corresponding Keys enum value.
auto all_key_names() noexcept
Returns a container of all key names.
std::string_view to_string(Keys key) noexcept
Converts a Keys enum value to its string representation.
auto all_keys() noexcept
Returns a container of all Keys enum values.
bool is_keypad_key(Keys key) noexcept
Checks if a key is a keypad key.
std::string enum_to_lowercase_string(EnumType value) noexcept
Universal enum to lowercase string converter using magic_enum.
constexpr std::string_view enum_to_string(EnumType value) noexcept
Universal enum to string converter using magic_enum (original case)