Changeset - r17386:e013a98ab036
[Not reviewed]
master
0 1 0
yexo - 14 years ago 2011-02-25 13:59:02
yexo@openttd.org
(svn r22142) -Fix (r22094): some valid keycodes were ignored along with the invalid ones
1 file changed with 2 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/hotkeys.cpp
Show inline comments
 
@@ -74,7 +74,8 @@ static uint16 ParseCode(const char *star
 
	}
 
	if (end - start == 1) {
 
		if (*start >= 'a' && *start <= 'z') return *start - ('a'-'A');
 
		return *start;
 
		/* Ignore invalid keycodes */
 
		if (*(uint8*)start < 128) return *start;
 
	}
 
	return 0;
 
}
 
@@ -99,10 +100,6 @@ static uint16 ParseKeycode(const char *s
 
			if (code & ~WKC_SPECIAL_KEYS) return 0;
 
			keycode |= code;
 
		} else {
 
			/* Ignore invalid keycodes */
 
			if (code >= 128) {
 
				return 0;
 
			}
 
			/* Ignore the code if it has more then 1 letter. */
 
			if (keycode & ~WKC_SPECIAL_KEYS) return 0;
 
			keycode |= code;
0 comments (0 inline, 0 general)