Skip to content

Commit 34b6439

Browse files
na-na-hikasper93
authored andcommitted
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: ce23677
1 parent d837c43 commit 34b6439

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

input/keycodes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ int mp_input_get_keys_from_string(char *name, int max_num_keys,
341341
n = 0;
342342
for (end = strchr(ptr, '-'); ; end = strchr(ptr, '-')) {
343343
if (end && end[1] != '\0') {
344-
if (end[1] == '-')
344+
if (*ptr == '-' && end[1] == '-')
345345
end = &end[1];
346346
end[0] = '\0';
347347
}

0 commit comments

Comments
 (0)