diff --git a/src/event/Input.cpp b/src/event/Input.cpp index 8a25fca..0eb76f7 100644 --- a/src/event/Input.cpp +++ b/src/event/Input.cpp @@ -54,6 +54,8 @@ uint32_t Input::s_metaKeyState; int32_t Input::s_queueHead; int32_t Input::s_queueTail; int32_t Input::s_windowFocused; +int (*s_confirmCloseCallback)(void*); +void* s_confirmCloseParam; #if defined(WHOA_SYSTEM_WIN) int32_t Input::s_savedMouseSpeed; @@ -360,6 +362,10 @@ void ConvertPosition(int32_t clientx, int32_t clienty, float* x, float* y) { *y = 1.0 - (static_cast(clienty) / static_cast(windowDim.bottom - windowDim.top)); } +void EventSetConfirmCloseCallback(int32_t (*callback)(void*), void* param) { + IEvtInputSetConfirmCloseCallback(callback, param); +} + void EventSetMouseMode(MOUSEMODE mode, uint32_t holdButton) { STORM_ASSERT(mode < MOUSE_MODES); STORM_VALIDATE(mode < MOUSE_MODES, ERROR_INVALID_PARAMETER); @@ -483,6 +489,11 @@ int32_t IEvtInputProcess(EvtContext* context, int32_t* shutdown) { return v4; } +void IEvtInputSetConfirmCloseCallback(int32_t (*callback)(void*),void* param) { + s_confirmCloseCallback = callback; + s_confirmCloseParam = param; +} + void IEvtInputSetMouseMode(EvtContext* context, MOUSEMODE mode, uint32_t holdButton) { STORM_ASSERT(context); STORM_VALIDATE(context, ERROR_INVALID_PARAMETER); diff --git a/src/event/Input.hpp b/src/event/Input.hpp index b899d39..38a432b 100644 --- a/src/event/Input.hpp +++ b/src/event/Input.hpp @@ -40,6 +40,8 @@ MOUSEBUTTON ConvertButtonNumberToMOUSEBUTTON(int32_t buttonNumber); void ConvertPosition(int32_t clientx, int32_t clienty, float* x, float* y); +void EventSetConfirmCloseCallback(int32_t (*callback)(void*), void* param); + void EventSetMouseMode(MOUSEMODE mode, uint32_t holdButton); uint32_t GenerateMouseFlags(); @@ -50,6 +52,8 @@ void IEvtInputInitialize(); int32_t IEvtInputProcess(EvtContext* context, int32_t* shutdown); +void IEvtInputSetConfirmCloseCallback(int32_t (*callback)(void*),void* param); + void IEvtInputSetMouseMode(EvtContext* context, MOUSEMODE mode, uint32_t holdButton); const char* KeyCodeToString(KEY key);