mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r22142) -Fix (r22094): some valid keycodes were ignored along with the invalid ones
This commit is contained in:
parent
b0b7e1172c
commit
f7f3db7174
|
@ -74,7 +74,8 @@ static uint16 ParseCode(const char *start, const char *end)
|
||||||
}
|
}
|
||||||
if (end - start == 1) {
|
if (end - start == 1) {
|
||||||
if (*start >= 'a' && *start <= 'z') return *start - ('a'-'A');
|
if (*start >= 'a' && *start <= 'z') return *start - ('a'-'A');
|
||||||
return *start;
|
/* Ignore invalid keycodes */
|
||||||
|
if (*(uint8*)start < 128) return *start;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -99,10 +100,6 @@ static uint16 ParseKeycode(const char *start, const char *end)
|
||||||
if (code & ~WKC_SPECIAL_KEYS) return 0;
|
if (code & ~WKC_SPECIAL_KEYS) return 0;
|
||||||
keycode |= code;
|
keycode |= code;
|
||||||
} else {
|
} else {
|
||||||
/* Ignore invalid keycodes */
|
|
||||||
if (code >= 128) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
/* Ignore the code if it has more then 1 letter. */
|
/* Ignore the code if it has more then 1 letter. */
|
||||||
if (keycode & ~WKC_SPECIAL_KEYS) return 0;
|
if (keycode & ~WKC_SPECIAL_KEYS) return 0;
|
||||||
keycode |= code;
|
keycode |= code;
|
||||||
|
|
Loading…
Reference in New Issue