diff options
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/console.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/ui/console.cc b/src/ui/console.cc index 7bd308e..67d5054 100644 --- a/src/ui/console.cc +++ b/src/ui/console.cc @@ -88,11 +88,18 @@ void Console::show() } void Console::hide() -{ +{ ui::Window::hide(); - SDL_WM_GrabInput(SDL_GRAB_ON); - SDL_ShowCursor(SDL_DISABLE); - + + core::Cvar *input_grab = core::Cvar::find("input_grab"); + if (!input_grab || input_grab->value()) { + SDL_WM_GrabInput(SDL_GRAB_ON); + SDL_ShowCursor(SDL_DISABLE); + } else { + SDL_WM_GrabInput(SDL_GRAB_OFF); + SDL_ShowCursor(SDL_ENABLE); + } + audio::play("ui/console"); } |