mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-11-18 07:34:59 -06:00
Add cursor condition to check if mouse button is held down
This commit is contained in:
@@ -17,6 +17,18 @@ std::chrono::high_resolution_clock::time_point GetLastMouseRightClickTime()
|
||||
{
|
||||
return {};
|
||||
}
|
||||
bool IsMouseLeftButtonDown()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool IsMouseMiddleButtonDown()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool IsMouseRightButtonDown()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace advss
|
||||
|
||||
@@ -6,5 +6,8 @@ namespace advss {
|
||||
std::chrono::high_resolution_clock::time_point GetLastMouseLeftClickTime();
|
||||
std::chrono::high_resolution_clock::time_point GetLastMouseMiddleClickTime();
|
||||
std::chrono::high_resolution_clock::time_point GetLastMouseRightClickTime();
|
||||
bool IsMouseLeftButtonDown();
|
||||
bool IsMouseMiddleButtonDown();
|
||||
bool IsMouseRightButtonDown();
|
||||
|
||||
} // namespace advss
|
||||
|
||||
@@ -278,6 +278,21 @@ std::chrono::high_resolution_clock::time_point GetLastMouseRightClickTime()
|
||||
return lastMouseRightClickTime;
|
||||
}
|
||||
|
||||
bool IsMouseLeftButtonDown()
|
||||
{
|
||||
return GetAsyncKeyState(VK_LBUTTON) & 0x8000;
|
||||
}
|
||||
|
||||
bool IsMouseMiddleButtonDown()
|
||||
{
|
||||
return GetAsyncKeyState(VK_MBUTTON) & 0x8000;
|
||||
}
|
||||
|
||||
bool IsMouseRightButtonDown()
|
||||
{
|
||||
return GetAsyncKeyState(VK_RBUTTON) & 0x8000;
|
||||
}
|
||||
|
||||
static void handleRawMouseInput(LPARAM lParam)
|
||||
{
|
||||
UINT dwSize;
|
||||
|
||||
Reference in New Issue
Block a user