//
// -[EAGLView keyDownExec:] from 0x1007461a0 to 0x100746439 (665 bytes)
//
// 1 xrefs:
// > ??> @ 0x100bdd388
//
// 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 12:36:31 +0000
//
void __cdecl -[EAGLView keyDownExec:](EAGLView *self, SEL a2, id a3)
{
double v3; // xmm0_8
unsigned __int16 v5; // ax
unsigned int v6; // ebx
__int64 *v7; // rax
__int64 v8; // rax
__int64 v9; // rax
unsigned int v10; // r12d
__int64 v11; // rax
__int64 v12; // rax
id v13; // r13
id v14; // r15
unsigned __int16 v15; // bx
unsigned __int16 v16; // ax
__int64 *v17; // rax
NSPasteboard *v18; // rax
NSString *v19; // rax
id v20; // r14
unsigned __int16 v21; // ax
const char *v22; // rax
const char *v23; // r14
__int64 *v24; // rbx
int v25; // eax
objc_msgSend(a3, "timestamp");
v5 = (unsigned __int16)objc_msgSend(a3, "keyCode");
v6 = -[EAGLView convertKeyCode:](self, "convertKeyCode:", v5);
if ( v6 != -1 )
{
v7 = cocos2d::CCIMEDispatcher::sharedDispatcher();
if ( !cocos2d::CCIMEDispatcher::hasDelegate((__int64)v7) || v6 == 27 || v6 == 13 )
{
v8 = cocos2d::CCDirector::sharedDirector();
v9 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v8 + 192LL))(v8);
cocos2d::CCKeyboardDispatcher::dispatchKeyboardMSG(v9, v6, 1, 0, v3);
}
}
v10 = (unsigned int)objc_msgSend(a3, "modifierFlags");
v11 = cocos2d::CCDirector::sharedDirector();
v12 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v11 + 192LL))(v11);
cocos2d::CCKeyboardDispatcher::updateModifierKeys(
v12,
(v10 >> 17) & 1,
(v10 >> 18) & 1,
(v10 >> 19) & 1,
(v10 >> 20) & 1);
v13 = a3;
v14 = objc_msgSend(a3, "charactersIgnoringModifiers");
if ( objc_msgSend(v14, "length") )
{
v15 = (unsigned __int16)objc_msgSend(v14, "characterAtIndex:", 0);
v16 = (unsigned __int16)objc_msgSend(v13, "keyCode");
if ( v15 == 63272 || v15 == 127 )
{
v17 = cocos2d::CCIMEDispatcher::sharedDispatcher();
cocos2d::CCIMEDispatcher::dispatchDeleteBackward(v17);
return;
}
if ( (v10 & 0x100000) != 0 && v16 == 9 )
{
v18 = +[NSPasteboard generalPasteboard](&OBJC_CLASS___NSPasteboard, "generalPasteboard");
v19 = -[NSPasteboard stringForType:](v18, "stringForType:", NSPasteboardTypeString);
if ( !v19 )
return;
v20 = v19;
if ( -[NSString isEqualToString:](v19, "isEqualToString:", NSPasteboardTypeString) )
return;
}
else
{
v20 = objc_msgSend(v13, "characters");
if ( !objc_msgSend(v20, "length") )
return;
v21 = (unsigned __int16)objc_msgSend(v20, "characterAtIndex:", 0);
if ( (unsigned __int16)(v21 + 2304) < 0x200u )
return;
if ( v21 == 13 )
{
v22 = (const char *)objc_msgSend(CFSTR("\n"), "UTF8String");
goto LABEL_20;
}
if ( v21 < 0x20u )
return;
}
v22 = (const char *)objc_msgSend(v20, "UTF8String");
LABEL_20:
if ( v22 )
{
v23 = v22;
if ( *v22 )
{
v24 = cocos2d::CCIMEDispatcher::sharedDispatcher();
v25 = strlen(v23);
cocos2d::CCIMEDispatcher::dispatchInsertText((__int64)v24, (__int64)v23, v25);
}
}
}
}