diff --git a/apps/openmw/mwgui/console.cpp b/apps/openmw/mwgui/console.cpp index 705e28138..cc900350d 100644 --- a/apps/openmw/mwgui/console.cpp +++ b/apps/openmw/mwgui/console.cpp @@ -229,7 +229,27 @@ namespace MWGui MyGUI::KeyCode key, MyGUI::Char _char) { - if( key == MyGUI::KeyCode::Tab) + if(MyGUI::InputManager::getInstance().isControlPressed()) + { + if(key == MyGUI::KeyCode::W) + { + std::string text = mCommandLine->getCaption(); + if(text.empty()) + return; + size_t max = text.size(); + while(max > 0 && (text[max - 1] == ' ' || text[max - 1] == '\t' || text[max - 1] == '>')) + max--; + while(max > 0 && text[max - 1] != ' ' && text[max - 1] != '\t' && text[max - 1] != '>') + max--; + text.resize(max); + mCommandLine->setCaption(text); + } + else if(key == MyGUI::KeyCode::U) + { + mCommandLine->setCaption(""); + } + } + else if(key == MyGUI::KeyCode::Tab) { std::vector matches; listNames();