More manual ANSI conversions for when Unicode is off

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@813 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud 2009-05-22 18:28:01 +00:00
parent e8dd8588d0
commit f4cb7985f2

View File

@ -546,7 +546,21 @@ word Keysym_to_ANSI(SDL_keysym keysym)
// Converty lowercase to uppercase if SHIFT is on. // Converty lowercase to uppercase if SHIFT is on.
if (keysym.sym >= 'a' && keysym.sym <= 'z' && (SDL_GetModState() & (KMOD_SHIFT|KMOD_CAPS))) if (keysym.sym >= 'a' && keysym.sym <= 'z' && (SDL_GetModState() & (KMOD_SHIFT|KMOD_CAPS)))
return ('A' - 'a') + keysym.sym; return ('A' - 'a') + keysym.sym;
return keysym.sym; // Convert keypad to numbers
if (keysym.sym >= SDLK_KP0 && keysym.sym <= SDLK_KP9)
return ('0' - SDLK_KP0) + keysym.sym;
// More conversions
switch (keysym.sym)
{
case SDLK_KP_PERIOD: return '.';
case SDLK_KP_DIVIDE: return '/';
case SDLK_KP_MINUS: return '-';
case SDLK_KP_PLUS: return '+';
case SDLK_KP_ENTER: return '\r';
case SDLK_KP_EQUALS: return '=';
default:
return keysym.sym;
}
} }
#endif #endif
// //