move check if ESCAPE to ItemVariable, didn't work in CKeyInput
This commit is contained in:
parent
5f73829bb9
commit
3befee0f6f
@ -10,6 +10,9 @@
|
|||||||
#include "common.hpp"
|
#include "common.hpp"
|
||||||
#include "sdk.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) {
|
CKeyInput::CKeyInput(std::string name, IWidget* parent) : CBaseWidget(name, parent) {
|
||||||
Props()->SetInt("value", 0);
|
Props()->SetInt("value", 0);
|
||||||
Props()->SetBool("capturing", false);
|
Props()->SetBool("capturing", false);
|
||||||
@ -62,7 +65,6 @@ bool CKeyInput::ConsumesKey(ButtonCode_t key) {
|
|||||||
|
|
||||||
void CKeyInput::OnKeyPress(ButtonCode_t key, bool repeat) {
|
void CKeyInput::OnKeyPress(ButtonCode_t key, bool repeat) {
|
||||||
if (Props()->GetBool("capturing")) {
|
if (Props()->GetBool("capturing")) {
|
||||||
if (key == KEY_ESCAPE) key = (ButtonCode_t)0;
|
|
||||||
SetValue(key);
|
SetValue(key);
|
||||||
if (m_pCallback) m_pCallback(this, key);
|
if (m_pCallback) m_pCallback(this, key);
|
||||||
Props()->SetBool("capturing", false);
|
Props()->SetBool("capturing", false);
|
||||||
|
@ -60,6 +60,8 @@ void ItemVariable::OnFocusLose() {
|
|||||||
|
|
||||||
void ItemVariable::OnKeyPress(ButtonCode_t key, bool repeat) {
|
void ItemVariable::OnKeyPress(ButtonCode_t key, bool repeat) {
|
||||||
if (capturing) {
|
if (capturing) {
|
||||||
|
if (key == 70)
|
||||||
|
key = (ButtonCode_t)0;
|
||||||
catvar = (int)key;
|
catvar = (int)key;
|
||||||
capturing = false;
|
capturing = false;
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user