diff options
author | Stijn Buys <ingar@osirion.org> | 2008-04-06 14:13:36 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-04-06 14:13:36 +0000 |
commit | 7b5a6b820d5acef36d402bd5a52d783ec68d33c7 (patch) | |
tree | a1cb65e071441277865ca5f4e315611cdd51c0e5 /src/client/input.cc | |
parent | 25d2c764443723eb7a3dd5f8bf0b76586c1ff10b (diff) |
mouse grabbing, Cvar and Func info
Diffstat (limited to 'src/client/input.cc')
-rw-r--r-- | src/client/input.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/client/input.cc b/src/client/input.cc index 88d1dd3..a7e67cc 100644 --- a/src/client/input.cc +++ b/src/client/input.cc @@ -35,7 +35,8 @@ int mouse_y = 0; void init() { con_print << "Initializing input..." << std::endl; - client::setkeyboardmode(console::visible()); + client::setkeyboardmode(false); + SDL_WM_GrabInput(SDL_GRAB_ON); // SDL_EnableUNICODE(1); } @@ -139,7 +140,7 @@ void frame(float seconds) if (event.key.keysym.sym == '`' || event.key.keysym.sym == '~') { last_control = 0; console::toggle(); - setkeyboardmode(console::visible()); + if (console::visible() && chat::visible()) chat::toggle(); } else if (console::visible()) { @@ -149,7 +150,6 @@ void frame(float seconds) } 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)); @@ -157,7 +157,6 @@ void frame(float seconds) } 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); |