//
// cocos2d::CCLayer::setKeyboardEnabled from 0x180050bd0 to 0x180050c67 (151 bytes)
//
// 11 xrefs:
// > ??> @ 0x1800ed2d0
// > ??> @ 0x1800ed790
// > ??> @ 0x1800edcc8
// > ??> @ 0x1800ee230
// > ??> @ 0x1800ee808
// > ??> @ 0x1800f70d8
// > ??> @ 0x180138084
// > ??> @ 0x180138098
// > ??> @ 0x1801380a8
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b2088
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall cocos2d::CCLayer::setKeyboardEnabled(cocos2d::CCLayer *this, bool a2)
{
bool v4; // zf
struct cocos2d::CCDirector *v5; // rax
cocos2d::CCKeyboardDelegate *v6; // rsi
cocos2d::CCDirector_vtbl *v7; // rdx
cocos2d::CCKeyboardDispatcher *v8; // rax
cocos2d::CCMouseDispatcher *v9; // rax
if ( a2 != this->m_bKeyboardEnabled )
{
v4 = !this->m_bRunning;
this->m_bKeyboardEnabled = a2;
if ( !v4 )
{
v5 = cocos2d::CCDirector::sharedDirector();
v6 = &this->cocos2d::CCKeyboardDelegate;
v7 = v5->cocos2d::CCObject::cocos2d::CCCopying::__vftable;
if ( a2 )
{
if ( !this )
v6 = nullptr;
v8 = (cocos2d::CCKeyboardDispatcher *)((__int64 (__fastcall *)(struct cocos2d::CCDirector *))v7->getKeyboardDispatcher)(v5);
cocos2d::CCKeyboardDispatcher::addDelegate(v8, (cocos2d::CCObject_vtbl *)v6);
}
else
{
if ( !this )
v6 = nullptr;
v9 = (cocos2d::CCMouseDispatcher *)((__int64 (__fastcall *)(struct cocos2d::CCDirector *))v7->getKeyboardDispatcher)(v5);
cocos2d::CCMouseDispatcher::removeDelegate(v9, (struct cocos2d::CCObject *)v6);
}
}
}
}