From 298d8e2ef42eb2c60f1a2c24cf1aeb131dcded09 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 26 Apr 2013 00:13:17 +0300 Subject: Add mod key for chat (left shift) New action: mod key + right click - close current whisper. --- src/gui/chatwindow.cpp | 16 +++++++++++++--- src/gui/setupactiondata.h | 5 +++++ 2 files changed, 18 insertions(+), 3 deletions(-) (limited to 'src/gui') diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp index 2892bb842..cde943c68 100644 --- a/src/gui/chatwindow.cpp +++ b/src/gui/chatwindow.cpp @@ -746,9 +746,19 @@ void ChatWindow::mousePressed(gcn::MouseEvent &event) Tab *const tab = mChatTabs->getSelectedTab(); if (tab) { - ChatTab *const cTab = dynamic_cast(tab); - if (cTab) - viewport->showChatPopup(cTab); + if (inputManager.isActionActive(static_cast( + Input::KEY_CHAT_MOD))) + { + ChatTab *const wTab = dynamic_cast(tab); + if (wTab) + wTab->handleCommand("close", ""); + } + else + { + ChatTab *const cTab = dynamic_cast(tab); + if (cTab) + viewport->showChatPopup(cTab); + } } } } diff --git a/src/gui/setupactiondata.h b/src/gui/setupactiondata.h index 38815898c..b47abace7 100644 --- a/src/gui/setupactiondata.h +++ b/src/gui/setupactiondata.h @@ -1010,6 +1010,11 @@ static SetupActionData setupActionData5[] = Input::KEY_CHAT_NEXT_HISTORY, "", }, + { + N_("Chat modifier key"), + Input::KEY_CHAT_MOD, + "", + }, { "", Input::KEY_NO_VALUE, -- cgit v1.2.3-70-g09d2