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 "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);
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user