refactor the code to not include BlockAndReadMouse() as a public API_FUNCTION()
This commit is contained in:
@@ -33,11 +33,6 @@ public:
|
||||
/// </summary
|
||||
API_FUNCTION() static void PickColor();
|
||||
|
||||
/// <summary>
|
||||
/// Blocks mouse input and runs a callback
|
||||
/// </summary>
|
||||
API_FUNCTION() static void BlockAndReadMouse();
|
||||
|
||||
/// <summary>
|
||||
/// Called when PickColor() is finished.
|
||||
/// </summary>
|
||||
|
||||
@@ -17,9 +17,10 @@ Int2 ScreenUtilities::GetScreenCursorPosition()
|
||||
class ScreenUtilitiesLinux
|
||||
{
|
||||
public:
|
||||
static void BlockAndReadMouse();
|
||||
};
|
||||
|
||||
void ScreenUtilities::BlockAndReadMouse()
|
||||
void ScreenUtilitiesLinux::BlockAndReadMouse()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ class ScreenUtilitiesWindows
|
||||
{
|
||||
public:
|
||||
static void PickSelected();
|
||||
static void BlockAndReadMouse();
|
||||
};
|
||||
|
||||
void ScreenUtilitiesWindows::PickSelected() {
|
||||
@@ -76,7 +77,7 @@ LRESULT CALLBACK ScreenUtilsMouseCallback(
|
||||
return CallNextHookEx(NULL, nCode, wParam, lParam);
|
||||
}
|
||||
|
||||
void ScreenUtilities::BlockAndReadMouse()
|
||||
void ScreenUtilitiesWindows::BlockAndReadMouse()
|
||||
{
|
||||
_mouseCallbackHook = SetWindowsHookEx(WH_MOUSE_LL, ScreenUtilsMouseCallback, NULL, NULL);
|
||||
if (_mouseCallbackHook == NULL)
|
||||
@@ -90,8 +91,7 @@ Delegate<Color32> ScreenUtilities::PickColorDone;
|
||||
|
||||
void ScreenUtilities::PickColor()
|
||||
{
|
||||
// MCore::AttachThread();
|
||||
BlockAndReadMouse();
|
||||
ScreenUtilitiesWindows::BlockAndReadMouse();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user