2023-01-26 20:02:46 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <FancyZonesLib/KeyState.h>
|
2023-06-13 14:31:22 +05:00
|
|
|
#include <FancyZonesLib/MouseButtonsHook.h>
|
2023-01-26 20:02:46 +03:00
|
|
|
|
|
|
|
|
class DraggingState
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
DraggingState(const std::function<void()>& keyUpdateCallback);
|
|
|
|
|
~DraggingState() = default;
|
|
|
|
|
|
|
|
|
|
void Enable();
|
|
|
|
|
void Disable();
|
|
|
|
|
void UpdateDraggingState() noexcept;
|
|
|
|
|
|
|
|
|
|
bool IsDragging() const noexcept;
|
|
|
|
|
bool IsSelectManyZonesState() const noexcept;
|
|
|
|
|
|
2024-03-28 17:53:17 +01:00
|
|
|
void SetShiftState(bool value) noexcept;
|
|
|
|
|
|
2023-01-26 20:02:46 +03:00
|
|
|
private:
|
2023-06-13 14:31:22 +05:00
|
|
|
void OnSecondaryMouseDown();
|
|
|
|
|
void OnMiddleMouseDown();
|
2023-01-26 20:02:46 +03:00
|
|
|
|
2023-06-13 14:31:22 +05:00
|
|
|
std::atomic<bool> m_secondaryMouseState;
|
|
|
|
|
std::atomic<bool> m_middleMouseState;
|
|
|
|
|
MouseButtonsHook m_mouseHook;
|
2023-01-26 20:02:46 +03:00
|
|
|
KeyState<VK_LCONTROL, VK_RCONTROL> m_ctrlKeyState;
|
2024-03-28 17:53:17 +01:00
|
|
|
|
|
|
|
|
bool m_shift{};
|
|
|
|
|
|
2023-01-26 20:02:46 +03:00
|
|
|
std::function<void()> m_keyUpdateCallback;
|
|
|
|
|
|
|
|
|
|
bool m_dragging{}; // True if we should be showing zone hints while dragging
|
|
|
|
|
};
|