Fixed Return key not sent in the SDL_ANDROID text input

This commit is contained in:
pelya
2011-06-03 14:06:27 +03:00
parent 550341ad8b
commit eb897e230a
6 changed files with 9 additions and 7 deletions

View File

@@ -22,6 +22,8 @@ RedefinedKeys="SPACE"
AppTouchscreenKeyboardKeysAmount=0
AppTouchscreenKeyboardKeysAmountAutoFire=0
RedefinedKeysScreenKb="1 2 3 4 5 6 1 2 3 4"
StartupMenuButtonTimeout=3000
HiddenMenuOptions=''
MultiABI=y
AppVersionCode=101
AppVersionName="1.01"

View File

@@ -509,12 +509,12 @@ int main(int argc, char* argv[])
SDL_Event evt;
while( SDL_PollEvent(&evt) )
{
if(evt.type & (SDL_KEYUP | SDL_KEYDOWN))
if(evt.type == SDL_KEYUP || evt.type == SDL_KEYDOWN)
{
Uint8 *keys = SDL_GetKeyState(&i);
if(keys[SDLK_ESCAPE])
return 0;
__android_log_print(ANDROID_LOG_INFO, "Ballfield", "SDL key event: state %d key %d mod %d unicode %d", evt.key.state, (int)evt.key.keysym.sym, (int)evt.key.keysym.mod, (int)evt.key.keysym.unicode);
__android_log_print(ANDROID_LOG_INFO, "Ballfield", "SDL key event: evt %s state %s key %d RETURN %d mod %d unicode %d", evt.type == SDL_KEYUP ? "UP " : "DOWN" , evt.key.state == SDL_PRESSED ? "PRESSED " : "RELEASED", (int)evt.key.keysym.sym, int(evt.key.keysym.sym == SDLK_RETURN), (int)evt.key.keysym.mod, (int)evt.key.keysym.unicode);
}
if(evt.type == SDL_VIDEORESIZE)
__android_log_print(ANDROID_LOG_INFO, "Ballfield", "SDL resize event: %d x %d", evt.resize.w, evt.resize.h);