mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-05-08 16:35:42 -04:00
Filter out Keypad as a mod in sdl_key_names (#1678)
This commit is contained in:
parent
617554bea7
commit
85ad091c22
@ -333,14 +333,22 @@ std::optional<u32> ParseKeyString(const std::string_view key_str)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
const std::string_view mod_part = key_str.substr(pos, plus_pos - pos);
|
const std::string_view mod_part = key_str.substr(pos, plus_pos - pos);
|
||||||
|
|
||||||
|
// Keypad in SDL is not a mod and should always be the last + in the string
|
||||||
|
bool known_mod = false;
|
||||||
for (const SDLKeyModifierEntry& mod : s_sdl_key_modifiers)
|
for (const SDLKeyModifierEntry& mod : s_sdl_key_modifiers)
|
||||||
{
|
{
|
||||||
if (mod_part == mod.name)
|
if (mod_part == mod.name)
|
||||||
{
|
{
|
||||||
modifiers |= static_cast<int>(mod.mod);
|
modifiers |= static_cast<int>(mod.mod);
|
||||||
|
known_mod = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!known_mod)
|
||||||
|
break;
|
||||||
|
|
||||||
pos = plus_pos + 1;
|
pos = plus_pos + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user