geode/loader/include/Geode/cocos/cocos2dx/robtop/keyboard_dispatcher/CCKeyboardDispatcher.h

64 lines
1.4 KiB
C
Raw Normal View History

2022-07-30 12:24:03 -04:00
#ifndef __CCKEYBOARD_DISPATCHER_H__
#define __CCKEYBOARD_DISPATCHER_H__
#include "CCKeyboardDelegate.h"
#include "cocoa/CCArray.h"
RT_ADD(
NS_CC_BEGIN
class CC_DLL CCKeyboardDispatcher : public CCObject
{
public:
CCKeyboardDispatcher();
virtual ~CCKeyboardDispatcher();
void addDelegate(CCKeyboardDelegate* pDelegate);
void removeDelegate(CCKeyboardDelegate* pDelegate);
void forceAddDelegate(CCKeyboardDelegate* pDelegate);
void forceRemoveDelegate(CCKeyboardDelegate* pDelegate);
enumKeyCodes convertKeyCode(enumKeyCodes key);
bool dispatchKeyboardMSG(enumKeyCodes key, bool);
inline bool getAltKeyPressed() const {
return m_bAltPressed;
}
inline bool getCommandKeyPressed() const {
return m_bCommandPressed;
}
inline bool getControlKeyPressed() const {
return m_bControlPressed;
}
inline bool getShiftKeyPressed() const {
return m_bShiftPressed;
}
GEODE_ADD(
static CCKeyboardDispatcher* get();
);
2022-07-30 12:24:03 -04:00
const char* keyToString(enumKeyCodes key);
void updateModifierKeys(bool shft, bool ctrl, bool alt, bool cmd);
protected:
CCArray* m_pDelegates; // 0x20
bool m_bUnknown24; // 0x24
bool m_bUnknown25; // 0x25
ccCArray* m_pUnknown28; // 0x28
ccCArray* m_pUnknown2c; // 0x2c
bool m_bShiftPressed; // 0x30
bool m_bControlPressed; // 0x31
bool m_bAltPressed; // 0x32
bool m_bCommandPressed; // 0x33
//there's more here, check the initializer
};
NS_CC_END
)
#endif