//
// cocos2d::CCKeypadHandler::handlerWithDelegate from 0x1800b7e20 to 0x1800b7ed8 (184 bytes)
//
// 5 xrefs:
// > cocos2d::CCKeypadDispatcher::addDelegate @ 0x1800b8126
// > cocos2d::CCKeypadDispatcher::dispatchKeypadMSG @ 0x1800b8288
// > cocos2d::CCKeypadDispatcher::forceAddDelegate @ 0x1800b82dc
// > ??> @ 0x18014cf68
// > ??> @ 0x1801c2b08
//
// This function is hookable on this platform (idp: pc, 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 11:22:22 +0000
//
struct cocos2d::CCKeypadHandler *__fastcall cocos2d::CCKeypadHandler::handlerWithDelegate(
struct cocos2d::CCKeypadDelegate *a1)
{
cocos2d::CCObject *v2; // rax
cocos2d::CCObject *v3; // rbx
bool (__fastcall *v4)(cocos2d::CCKeypadHandler *__hidden, struct cocos2d::CCKeypadDelegate *); // r8
cocos2d::CCObject *v5; // rax
v2 = (cocos2d::CCObject *)sub_1800E4AC0(0x40u);
v3 = v2;
if ( v2 )
{
cocos2d::CCObject::CCObject(v2);
*(_QWORD *)v3 = &cocos2d::CCKeypadHandler::`vftable';
}
else
{
v3 = nullptr;
}
if ( !v3 )
return v3;
v4 = *(bool (__fastcall **)(cocos2d::CCKeypadHandler *__hidden, struct cocos2d::CCKeypadDelegate *))(*(_QWORD *)v3 + 72LL);
if ( v4 == cocos2d::CCKeypadHandler::initWithDelegate )
{
*((_QWORD *)v3 + 7) = a1;
v5 = (cocos2d::CCObject *)_RTDynamicCast(
a1,
0,
&cocos2d::CCKeypadDelegate `RTTI Type Descriptor',
&cocos2d::CCObject `RTTI Type Descriptor',
0);
cocos2d::CCObject::retain(v5);
LABEL_8:
cocos2d::CCObject::autorelease(v3);
return v3;
}
if ( v4(v3, a1) )
goto LABEL_8;
cocos2d::CCObject::release(v3);
return nullptr;
}