mirror of
https://github.com/glest/glest-source.git
synced 2025-08-21 15:41:24 +02:00
- fixed debug key
This commit is contained in:
@@ -69,7 +69,7 @@ void ChatManager::keyUp(SDL_KeyboardEvent key) {
|
|||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] key = [%c] [%d]\n",__FILE__,__FUNCTION__,__LINE__,key.keysym.sym,key.keysym.sym);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] key = [%c] [%d]\n",__FILE__,__FUNCTION__,__LINE__,key.keysym.sym,key.keysym.sym);
|
||||||
|
|
||||||
//if(key == vkEscape || key == SDLK_ESCAPE) {
|
//if(key == vkEscape || key == SDLK_ESCAPE) {
|
||||||
if(isKeyPressed(SDLK_ESCAPE,key) == true) {
|
if(isKeyPressed(SDLK_ESCAPE,key,false) == true) {
|
||||||
text.clear();
|
text.clear();
|
||||||
editEnabled= false;
|
editEnabled= false;
|
||||||
}
|
}
|
||||||
@@ -110,7 +110,7 @@ void ChatManager::keyDown(SDL_KeyboardEvent key) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//if(key==vkReturn) {
|
//if(key==vkReturn) {
|
||||||
if(isKeyPressed(SDLK_RETURN,key) == true) {
|
if(isKeyPressed(SDLK_RETURN,key, false) == true) {
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] key = [%c] [%d]\n",__FILE__,__FUNCTION__,__LINE__,key.keysym.sym,key.keysym.sym);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] key = [%c] [%d]\n",__FILE__,__FUNCTION__,__LINE__,key.keysym.sym,key.keysym.sym);
|
||||||
|
|
||||||
//SDL_keysym keystate = Window::getKeystate();
|
//SDL_keysym keystate = Window::getKeystate();
|
||||||
@@ -155,7 +155,7 @@ void ChatManager::keyDown(SDL_KeyboardEvent key) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//else if(key==vkBack) {
|
//else if(key==vkBack) {
|
||||||
else if(isKeyPressed(SDLK_BACKSPACE,key) == true) {
|
else if(isKeyPressed(SDLK_BACKSPACE,key,false) == true) {
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] key = [%c] [%d]\n",__FILE__,__FUNCTION__,__LINE__,key.keysym.sym,key.keysym.sym);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] key = [%c] [%d]\n",__FILE__,__FUNCTION__,__LINE__,key.keysym.sym,key.keysym.sym);
|
||||||
|
|
||||||
if(!text.empty()) {
|
if(!text.empty()) {
|
||||||
|
@@ -947,7 +947,7 @@ char Window::getKey(SDL_keysym keysym,bool skipSpecialKeys) {
|
|||||||
bool isKeyPressed(SDLKey compareKey, SDL_KeyboardEvent input,bool modifiersAllowed) {
|
bool isKeyPressed(SDLKey compareKey, SDL_KeyboardEvent input,bool modifiersAllowed) {
|
||||||
Uint16 c = SDLK_UNKNOWN;
|
Uint16 c = SDLK_UNKNOWN;
|
||||||
//if(input.keysym.unicode > 0 && input.keysym.unicode < 0x80) {
|
//if(input.keysym.unicode > 0 && input.keysym.unicode < 0x80) {
|
||||||
if(input.keysym.unicode > 0 && input.keysym.unicode < 0x80) {
|
if(input.keysym.unicode > 0) {
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
// When modifiers are pressed the unicode result is wrong
|
// When modifiers are pressed the unicode result is wrong
|
||||||
@@ -961,6 +961,11 @@ bool isKeyPressed(SDLKey compareKey, SDL_KeyboardEvent input,bool modifiersAllow
|
|||||||
c = input.keysym.unicode;
|
c = input.keysym.unicode;
|
||||||
//c = toupper(c);
|
//c = toupper(c);
|
||||||
}
|
}
|
||||||
|
else if(c == SDLK_QUESTION &&
|
||||||
|
(input.keysym.mod & KMOD_LSHIFT) == KMOD_LSHIFT ||
|
||||||
|
(input.keysym.mod & KMOD_RSHIFT) == KMOD_RSHIFT) {
|
||||||
|
c = input.keysym.unicode;
|
||||||
|
}
|
||||||
|
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf ("In [%s::%s Line: %d] #1 (c & 0xFF) [%d]\n",__FILE__,__FUNCTION__,__LINE__,(c & 0xFF));
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf ("In [%s::%s Line: %d] #1 (c & 0xFF) [%d]\n",__FILE__,__FUNCTION__,__LINE__,(c & 0xFF));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user