[FancyZones] Hold Ctrl to select any number of zones (#4850)

* Started work

* Did something, not yet sure that it works

* Sort of works

* Cleari highlighted zones when using Ctrl after leaving a monitor

* Remove unnecessary line

* Enhanced UX. Maybe refactor?

* Changed the logic behind zone selection when dragging

* Various fixups
This commit is contained in:
Ivan Stošić
2020-07-10 11:06:01 +02:00
committed by GitHub
parent b1d662a5b1
commit 412d80efe3
12 changed files with 203 additions and 109 deletions

View File

@@ -1,14 +1,15 @@
#pragma once
#include "SecondaryMouseButtonsHook.h"
#include "GenericKeyHook.h"
interface IFancyZonesSettings;
interface IZoneWindow;
class SecondaryMouseButtonsHook;
class ShiftKeyHook;
class WindowMoveHandler
{
public:
WindowMoveHandler(const winrt::com_ptr<IFancyZonesSettings>& settings, SecondaryMouseButtonsHook* mouseHook, ShiftKeyHook* shiftHook);
WindowMoveHandler(const winrt::com_ptr<IFancyZonesSettings>& settings, SecondaryMouseButtonsHook* mouseHook, ShiftKeyHook* shiftHook, CtrlKeyHook* ctrlHook);
~WindowMoveHandler();
bool InMoveSize() const noexcept;
@@ -16,6 +17,7 @@ public:
void OnMouseDown() noexcept;
void OnShiftChangeState(bool state) noexcept; //True for shift down event false for shift up
void OnCtrlChangeState(bool state) noexcept; //True for ctrl down event false for ctrl up
void MoveSizeStart(HWND window, HMONITOR monitor, POINT const& ptScreen, const std::unordered_map<HMONITOR, winrt::com_ptr<IZoneWindow>>& zoneWindowMap) noexcept;
void MoveSizeUpdate(HMONITOR monitor, POINT const& ptScreen, const std::unordered_map<HMONITOR, winrt::com_ptr<IZoneWindow>>& zoneWindowMap) noexcept;