//
// KeybindCapturePopup::onToggleController from 0xcf7df4 to 0xcf7e84 (144 bytes)
//
// 3 xrefs:
// > ??> @ 0xcbef0
// > KeybindCapturePopup::init @ 0xcf768c
// > ??> @ 0x1545fd8
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 13:06:49 +0000
//
__int64 __fastcall KeybindCapturePopup::onToggleController(KeybindCapturePopup *this, cocos2d::CCObject *a2)
{
__int64 result; // x0
int v4; // w20
int v5; // w1
unsigned __int16 v6; // w0
result = *((_QWORD *)this + 134);
if ( result )
{
v4 = *(unsigned __int8 *)(result + 328) ^ 1;
ControllerInputNode::setController2((ControllerInputNode *)result, *(_BYTE *)(result + 328) ^ 1);
result = *((unsigned int *)this + 262);
if ( (_DWORD)result )
{
result = GJKeybindManager::isControllerChord((GJKeybindManager *)result);
if ( (_BYTE)result )
{
v5 = *((_DWORD *)this + 262);
if ( v4 )
v6 = v5 + (v5 & 1);
else
v6 = v5 - !(v5 & 1);
*((_DWORD *)this + 262) = GJKeybindManager::encodeChord(v6, 0, 0, 0);
return KeybindCapturePopup::updateChordDisplay(this);
}
}
}
return result;
}