[FancyZones]Use RawInput to detect Shift key, fix locking out Shift key (#32116)

* init RawInputDevice

* static

* handle input

* replace keyboard hooks (ctrl, shift)

* keep ctrl hook

* spellcheck
This commit is contained in:
Seraphima Zykova
2024-03-28 17:53:17 +01:00
committed by GitHub
parent baba63542d
commit 6333e3157e
7 changed files with 119 additions and 29 deletions

View File

@@ -16,6 +16,8 @@ public:
bool IsDragging() const noexcept;
bool IsSelectManyZonesState() const noexcept;
void SetShiftState(bool value) noexcept;
private:
void OnSecondaryMouseDown();
void OnMiddleMouseDown();
@@ -23,9 +25,10 @@ private:
std::atomic<bool> m_secondaryMouseState;
std::atomic<bool> m_middleMouseState;
MouseButtonsHook m_mouseHook;
KeyState<VK_LSHIFT> m_leftShiftKeyState;
KeyState<VK_RSHIFT> m_rightShiftKeyState;
KeyState<VK_LCONTROL, VK_RCONTROL> m_ctrlKeyState;
bool m_shift{};
std::function<void()> m_keyUpdateCallback;
bool m_dragging{}; // True if we should be showing zone hints while dragging