diff options
author | Stijn Buys <ingar@osirion.org> | 2008-02-23 17:10:35 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-02-23 17:10:35 +0000 |
commit | 5c734fe66e9ace93c03937adc2fc56336fb474fb (patch) | |
tree | d4d4ffebd4215b0f1f42d6a4ac9275ec8cd686ea /src/client/input.cc | |
parent | 82c06412ef39522c4deab457ce7a3e78160d8a19 (diff) |
client chatbox and message notifications
Diffstat (limited to 'src/client/input.cc')
-rw-r--r-- | src/client/input.cc | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/client/input.cc b/src/client/input.cc index c9c2514..b339574 100644 --- a/src/client/input.cc +++ b/src/client/input.cc @@ -7,6 +7,7 @@ #include "core/core.h" #include "client/client.h" #include "client/input.h" +#include "client/chat.h" #include "client/console.h" #include "client/camera.h" #include "client/keyboard.h" @@ -115,12 +116,29 @@ void frame(float seconds) case SDL_KEYDOWN: if (event.key.keysym.sym == '`' || event.key.keysym.sym == '~') { console::toggle(); + setkeyboardmode(console::visible()); + if (console::visible() && chat::visible()) + chat::toggle(); } else if (console::visible()) { // send key events to the console console::keypressed(translate_keysym(event.key.keysym)); - } else if (core::application()->connected() && core::localcontrol()) { - // send key events to the game world - keypressed(event.key.keysym); + + } else if (chat::visible()) { + if(event.key.keysym.sym == SDLK_ESCAPE) { + chat::toggle(); + setkeyboardmode(chat::visible()); + } else { + // send key events to the chatbox + chat::keypressed(translate_keysym(event.key.keysym)); + } + } else if(core::application()->connected()) { + if ((event.key.keysym.sym == 't') || (event.key.keysym.sym == 'T')) { + chat::toggle(); + setkeyboardmode(chat::visible()); + } else if (core::localcontrol()) { + // send key events to the game world + keypressed(event.key.keysym); + } } break; case SDL_QUIT: |