Input: Fix "," key in keyboard pad handler

This commit is contained in:
Megamouse 2023-10-06 01:32:45 +02:00
parent 830b1a8a8d
commit 9fce70809e
2 changed files with 9 additions and 3 deletions

View File

@ -8,7 +8,13 @@ extern std::string g_input_config_override;
std::vector<std::string> cfg_pad::get_buttons(const std::string& str)
{
std::vector<std::string> vec = fmt::split(str, {","});;
std::vector<std::string> vec = fmt::split(str, {","});
// Handle special case: string contains separator itself as configured value
if (str == "," || str.find(",,") != umax)
{
vec.push_back(",");
}
// Remove duplicates
std::sort(vec.begin(), vec.end());

View File

@ -213,13 +213,13 @@ bool emu_settings::ValidateSettings(bool cleanup)
}
else
{
const auto get_full_key = [&keys](const std::string& seperator) -> std::string
const auto get_full_key = [&keys](const std::string& separator) -> std::string
{
std::string full_key;
for (usz i = 0; i < keys.size(); i++)
{
full_key += keys[i];
if (i < keys.size() - 1) full_key += seperator;
if (i < keys.size() - 1) full_key += separator;
}
return full_key;
};