From f7897778ff3fc752e217de27d6d8fa76984beb3e Mon Sep 17 00:00:00 2001 From: spycrab Date: Sun, 24 Mar 2019 15:57:36 +0100 Subject: NetPlayChatUI: Add activate chat hotkey --- Source/Core/VideoCommon/NetPlayChatUI.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'Source/Core/VideoCommon/NetPlayChatUI.cpp') diff --git a/Source/Core/VideoCommon/NetPlayChatUI.cpp b/Source/Core/VideoCommon/NetPlayChatUI.cpp index 2388d94b91..7587229ee0 100644 --- a/Source/Core/VideoCommon/NetPlayChatUI.cpp +++ b/Source/Core/VideoCommon/NetPlayChatUI.cpp @@ -60,7 +60,12 @@ void NetPlayChatUI::Display() ImGuiInputTextFlags_EnterReturnsTrue)) { SendMessage(); + } + + if (m_activate) + { ImGui::SetKeyboardFocusHere(-1); + m_activate = false; } ImGui::PopItemWidth(); @@ -97,3 +102,11 @@ void NetPlayChatUI::SendMessage() m_message_buf[0] = '\0'; } } + +void NetPlayChatUI::Activate() +{ + if (ImGui::IsItemFocused()) + ImGui::SetWindowFocus(NULL); + else + m_activate = true; +} -- cgit v1.2.3