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

66 lines
1.5 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"
2022-07-30 12:24:03 -04:00
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);
2023-12-22 08:38:11 -05:00
static enumKeyCodes convertKeyCode(enumKeyCodes key);
2022-07-30 12:24:03 -04:00
2023-12-20 21:14:53 -05:00
bool dispatchKeyboardMSG(enumKeyCodes key, bool, bool);
2022-07-30 12:24:03 -04:00
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;
}
static GEODE_DLL 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);
2023-12-20 21:14:53 -05:00
bool getBlockRepeat() const;
void setBlockRepeat(bool);
2022-07-30 12:24:03 -04:00
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