From 5c6d778af16e5a30575bbdb46dead6bfaf6d9113 Mon Sep 17 00:00:00 2001 From: Jmgr Date: Sun, 30 May 2021 20:30:39 +0100 Subject: [PATCH] Keymapper: fix actions being triggered while the chatbox is open --- Source/controls/keymapper.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/controls/keymapper.cpp b/Source/controls/keymapper.cpp index 164009954..6b023fe3b 100644 --- a/Source/controls/keymapper.cpp +++ b/Source/controls/keymapper.cpp @@ -9,6 +9,7 @@ #include "utils/sdl2_to_1_2_backports.h" #endif +#include "../control.h" #include "../miniwin/miniwin.h" #include "utils/log.hpp" @@ -51,8 +52,9 @@ void Keymapper::keyPressed(int key) const auto &action = it->second; - // Some actions cannot always be triggered. - if (!action.get().enable()) + // Check that the action can be triggered and that the chat textbox is not + // open. + if (!action.get().enable() || talkflag) return; action();