From 75fd674d31c53aa68a2e84ad74c0b2310069d084 Mon Sep 17 00:00:00 2001 From: Braden Obrzut Date: Sat, 18 Jan 2014 16:20:52 -0500 Subject: [PATCH] - If the player doesn't have ` bound to open the console, don't close it with that key. --- src/c_console.cpp | 7 +++++++ src/doomdef.h | 1 + 2 files changed, 8 insertions(+) diff --git a/src/c_console.cpp b/src/c_console.cpp index e5d3d97ab1..e202296053 100644 --- a/src/c_console.cpp +++ b/src/c_console.cpp @@ -41,6 +41,7 @@ #include "version.h" #include "g_game.h" +#include "c_bind.h" #include "c_console.h" #include "c_cvars.h" #include "c_dispatch.h" @@ -1698,6 +1699,12 @@ static bool C_HandleKey (event_t *ev, BYTE *buffer, int len) break; case '`': + // Check to see if we have ` bound to the console before accepting + // it as a way to close the console. + if (Bindings.GetBinding(KEY_GRAVE).CompareNoCase("toggleconsole")) + { + break; + } case GK_ESCAPE: // Close console and clear command line. But if we're in the // fullscreen console mode, there's nothing to fall back on diff --git a/src/doomdef.h b/src/doomdef.h index 675923b4a4..e08c3044d6 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -130,6 +130,7 @@ enum ESkillLevels #define KEY_F10 0x44 // DIK_F10 #define KEY_F11 0x57 // DIK_F11 #define KEY_F12 0x58 // DIK_F12 +#define KEY_GRAVE 0x29 // DIK_GRAVE #define KEY_BACKSPACE 0x0e // DIK_BACK