//
// cocos2d::CCLayer::setKeyboardEnabled from 0x1800529f0 to 0x180052a87 (151 bytes)
//
// 11 xrefs:
// > ??> @ 0x1800f3430
// > ??> @ 0x1800f3910
// > ??> @ 0x1800f3e68
// > ??> @ 0x1800f43f0
// > ??> @ 0x1800f49e8
// > ??> @ 0x1800fd520
// > ??> @ 0x1801412ac
// > ??> @ 0x1801412c0
// > ??> @ 0x1801412d0
// > ??> @ 0x18014cf68
// > ??> @ 0x1801bc31c
//
// 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:21:46 +0000
//
void __fastcall cocos2d::CCLayer::setKeyboardEnabled(cocos2d::CCLayer *this, char a2)
{
bool v4; // zf
struct cocos2d::CCDirector *v5; // rax
struct cocos2d::CCKeyboardDelegate *v6; // rsi
__int64 v7; // rdx
cocos2d::CCKeyboardDispatcher *v8; // rax
cocos2d::CCMouseDispatcher *v9; // rax
if ( a2 != *((_BYTE *)this + 363) )
{
v4 = *((_BYTE *)this + 272) == 0;
*((_BYTE *)this + 363) = a2;
if ( !v4 )
{
v5 = cocos2d::CCDirector::sharedDirector();
v6 = (cocos2d::CCLayer *)((char *)this + 344);
v7 = *(_QWORD *)v5;
if ( a2 )
{
if ( !this )
v6 = nullptr;
v8 = (cocos2d::CCKeyboardDispatcher *)(*(__int64 (__fastcall **)(struct cocos2d::CCDirector *))(v7 + 176))(v5);
cocos2d::CCKeyboardDispatcher::addDelegate(v8, v6);
}
else
{
if ( !this )
v6 = nullptr;
v9 = (cocos2d::CCMouseDispatcher *)(*(__int64 (__fastcall **)(struct cocos2d::CCDirector *))(v7 + 176))(v5);
cocos2d::CCMouseDispatcher::removeDelegate(v9, v6);
}
}
}
}