- bugfix for alpha letter keys used for certain hotkey operations

This commit is contained in:
Mark Vejvoda
2011-03-10 18:26:45 +00:00
parent 9636d5db06
commit 2f18f96743
3 changed files with 14 additions and 3 deletions

View File

@@ -1303,7 +1303,7 @@ void Game::keyDown(char key) {
if(chatManager.getEditEnabled() == false) {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] key = [%d - %c]\n",__FILE__,__FUNCTION__,__LINE__,key,key);
if(SystemFlags::VERBOSE_MODE_ENABLED) printf ("In [%s::%s Line: %d] key = [%d - %c]\n",__FILE__,__FUNCTION__,__LINE__,key,key);
//if(SystemFlags::VERBOSE_MODE_ENABLED) printf ("In [%s::%s Line: %d] key = [%d - %c]\n",__FILE__,__FUNCTION__,__LINE__,key,key);
Config &configKeys = Config::getInstance(std::pair<ConfigType,ConfigType>(cfgMainKeys,cfgUserKeys));

View File

@@ -647,6 +647,11 @@ void MainWindow::eventKeyDown(char key){
throw runtime_error("In [MainWindow::eventKeyDown] ERROR, program == NULL!");
}
//{
//Config &configKeys = Config::getInstance(std::pair<ConfigType,ConfigType>(cfgMainKeys,cfgUserKeys));
//printf("----------------------- key [%d] CameraModeLeft [%d]\n",key,configKeys.getCharKey("CameraModeLeft"));
//}
program->keyDown(key);
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);

View File

@@ -185,7 +185,11 @@ bool Window::handleEvent() {
toggleFullscreen();
}
if(global_window) {
global_window->eventKeyDown(getKey(event.key.keysym,true));
char key = getKey(event.key.keysym,true);
key = tolower(key);
//if(SystemFlags::VERBOSE_MODE_ENABLED) printf ("******************* key [%d]\n",key);
global_window->eventKeyDown(key);
global_window->eventKeyPress(getRawKey(event.key.keysym));
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
@@ -208,7 +212,9 @@ bool Window::handleEvent() {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] KEY_UP, 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);
if(global_window) {
global_window->eventKeyUp(getKey(event.key.keysym,true));
char key = getKey(event.key.keysym,true);
key = tolower(key);
global_window->eventKeyUp(key);
}
if(SystemFlags::VERBOSE_MODE_ENABLED) printf ("In [%s::%s Line: %d] =================================== END OF SDL SDL_KEYUP ================================\n",__FILE__,__FUNCTION__,__LINE__);