From 3befee0f6f55198a06159371ea841244bbdf20b5 Mon Sep 17 00:00:00 2001 From: LIghty Date: Tue, 20 Mar 2018 16:58:44 +0100 Subject: [PATCH] move check if ESCAPE to ItemVariable, didn't work in CKeyInput --- src/menu/CKeyInput.cpp | 4 +++- src/menu/ncc/ItemVariable.cpp | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/menu/CKeyInput.cpp b/src/menu/CKeyInput.cpp index 5ab890d8..744bda42 100644 --- a/src/menu/CKeyInput.cpp +++ b/src/menu/CKeyInput.cpp @@ -10,6 +10,9 @@ #include "common.hpp" #include "sdk.hpp" +CatVar var0(CV_SWITCH, "var0", "0", "Enable Aimbot", + "Main aimbot switch"); + CKeyInput::CKeyInput(std::string name, IWidget* parent) : CBaseWidget(name, parent) { Props()->SetInt("value", 0); Props()->SetBool("capturing", false); @@ -62,7 +65,6 @@ bool CKeyInput::ConsumesKey(ButtonCode_t key) { void CKeyInput::OnKeyPress(ButtonCode_t key, bool repeat) { if (Props()->GetBool("capturing")) { - if (key == KEY_ESCAPE) key = (ButtonCode_t)0; SetValue(key); if (m_pCallback) m_pCallback(this, key); Props()->SetBool("capturing", false); diff --git a/src/menu/ncc/ItemVariable.cpp b/src/menu/ncc/ItemVariable.cpp index 77fcd962..8fde23d9 100644 --- a/src/menu/ncc/ItemVariable.cpp +++ b/src/menu/ncc/ItemVariable.cpp @@ -60,6 +60,8 @@ void ItemVariable::OnFocusLose() { void ItemVariable::OnKeyPress(ButtonCode_t key, bool repeat) { if (capturing) { + if (key == 70) + key = (ButtonCode_t)0; catvar = (int)key; capturing = false; return;