Input: Fix "," key in keyboard pad handler
This commit is contained in:
@@ -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> 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
|
// Remove duplicates
|
||||||
std::sort(vec.begin(), vec.end());
|
std::sort(vec.begin(), vec.end());
|
||||||
|
|||||||
@@ -213,13 +213,13 @@ bool emu_settings::ValidateSettings(bool cleanup)
|
|||||||
}
|
}
|
||||||
else
|
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;
|
std::string full_key;
|
||||||
for (usz i = 0; i < keys.size(); i++)
|
for (usz i = 0; i < keys.size(); i++)
|
||||||
{
|
{
|
||||||
full_key += keys[i];
|
full_key += keys[i];
|
||||||
if (i < keys.size() - 1) full_key += seperator;
|
if (i < keys.size() - 1) full_key += separator;
|
||||||
}
|
}
|
||||||
return full_key;
|
return full_key;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user