input/keycodes: fix combo key handling for - key

The current handling tries to handle the edge case where the current key
in a combo key is -, but when the current key is not - and the next key
is -, it misdetects - as separator and fails to parse correctly.

Fix this by restricting the handling to situations where the current key
is -.

Fixes: ce2367725e
This commit is contained in:
nanahi
2025-09-12 09:35:36 -04:00
committed by Kacper Michajłow
parent d837c43656
commit 34b6439dc6
+1 -1
View File
@@ -341,7 +341,7 @@ int mp_input_get_keys_from_string(char *name, int max_num_keys,
n = 0;
for (end = strchr(ptr, '-'); ; end = strchr(ptr, '-')) {
if (end && end[1] != '\0') {
if (end[1] == '-')
if (*ptr == '-' && end[1] == '-')
end = &end[1];
end[0] = '\0';
}