From 3f32cddbf533b81205400ddc20750f7decb79321 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Tue, 1 Mar 2011 23:07:19 +0000 Subject: [PATCH] - added sdl keyname to console output and debug log (console when --verbose commandline option used) --- source/shared_lib/sources/platform/sdl/window.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/shared_lib/sources/platform/sdl/window.cpp b/source/shared_lib/sources/platform/sdl/window.cpp index 36ca7ce5..23473c45 100644 --- a/source/shared_lib/sources/platform/sdl/window.cpp +++ b/source/shared_lib/sources/platform/sdl/window.cpp @@ -166,11 +166,14 @@ bool Window::handleEvent() { case SDL_KEYDOWN: //printf("In [%s::%s] Line :%d\n",__FILE__,__FUNCTION__,__LINE__); + { codeLocation = "i"; Window::isKeyPressedDown = true; keystate = event.key.keysym; - SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] Raw SDL key [%d] mod [%d] unicode [%d] scancode [%d]\n",__FILE__,__FUNCTION__,__LINE__,event.key.keysym.sym,event.key.keysym.mod,event.key.keysym.unicode,event.key.keysym.scancode); + string keyName = SDL_GetKeyName(event.key.keysym.sym); + if(SystemFlags::VERBOSE_MODE_ENABLED) printf ("In [%s::%s Line: %d] Raw SDL key [%d] mod [%d] unicode [%d] scancode [%d] keyName [%s]\n",__FILE__,__FUNCTION__,__LINE__,event.key.keysym.sym,event.key.keysym.mod,event.key.keysym.unicode,event.key.keysym.scancode,keyName.c_str()); + SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] Raw SDL key [%d] mod [%d] unicode [%d] scancode [%d] keyName [%s]\n",__FILE__,__FUNCTION__,__LINE__,event.key.keysym.sym,event.key.keysym.mod,event.key.keysym.unicode,event.key.keysym.scancode,keyName.c_str()); /* handle ALT+Return */ if(event.key.keysym.sym == SDLK_RETURN @@ -184,6 +187,7 @@ bool Window::handleEvent() { SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); } + } break; case SDL_KEYUP: