refactor the code to not include BlockAndReadMouse() as a public API_FUNCTION()

This commit is contained in:
Menotdan
2023-05-17 21:44:26 -04:00
parent 48f890dd80
commit 6e6a427488
3 changed files with 5 additions and 9 deletions

View File

@@ -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>

View File

@@ -17,9 +17,10 @@ Int2 ScreenUtilities::GetScreenCursorPosition()
class ScreenUtilitiesLinux
{
public:
static void BlockAndReadMouse();
};
void ScreenUtilities::BlockAndReadMouse()
void ScreenUtilitiesLinux::BlockAndReadMouse()
{
}

View File

@@ -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();
}