7 constexpr std::array<std::pair<char, Keys>, 10> char_to_keys = { {
23 for (
const auto& [ch, key] : char_to_keys) {
28 if (c >=
'0' && c <=
'9') {
29 return static_cast<Keys>(
static_cast<int>(c));
31 if (c >=
'A' && c <=
'Z') {
32 return static_cast<Keys>(
static_cast<int>(c));
34 if (c >=
'a' && c <=
'z') {
35 return static_cast<Keys>(
static_cast<int>(c) - 32);
47 if (str.length() == 1) {
51 return Utils::string_to_enum_case_insensitive<Keys>(str);
66 int k =
static_cast<int>(key);
67 return k >= 32 && k <= 126;
77 int k =
static_cast<int>(key);
78 return k >= 290 && k <= 314;
83 int k =
static_cast<int>(key);
84 return k >= 320 && k <= 336;
89 return Utils::get_enum_names_lowercase<Keys>();
94 return Utils::get_enum_names<Keys>();
99 return Utils::get_enum_values<Keys>();
104 return Utils::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)