mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
[FindMyMouse]Account for low double click settings (#14291)
This commit is contained in:
@@ -55,6 +55,7 @@ protected:
|
|||||||
POINT m_sonarPos = ptNowhere;
|
POINT m_sonarPos = ptNowhere;
|
||||||
|
|
||||||
// Only consider double left control click if at least 100ms passed between the clicks, to avoid keyboards that might be sending rapid clicks.
|
// Only consider double left control click if at least 100ms passed between the clicks, to avoid keyboards that might be sending rapid clicks.
|
||||||
|
// At actual check, time a fifth of the current double click setting might be used instead to take into account users who might have low values.
|
||||||
static const int MIN_DOUBLE_CLICK_TIME = 100;
|
static const int MIN_DOUBLE_CLICK_TIME = 100;
|
||||||
|
|
||||||
static constexpr int SonarRadius = 100;
|
static constexpr int SonarRadius = 100;
|
||||||
@@ -312,9 +313,10 @@ void SuperSonar<D>::OnSonarKeyboardInput(RAWINPUT const& input)
|
|||||||
auto now = GetTickCount();
|
auto now = GetTickCount();
|
||||||
auto doubleClickInterval = now - m_lastKeyTime;
|
auto doubleClickInterval = now - m_lastKeyTime;
|
||||||
POINT ptCursor{};
|
POINT ptCursor{};
|
||||||
|
auto doubleClickTimeSetting = GetDoubleClickTime();
|
||||||
if (GetCursorPos(&ptCursor) &&
|
if (GetCursorPos(&ptCursor) &&
|
||||||
doubleClickInterval >= MIN_DOUBLE_CLICK_TIME &&
|
doubleClickInterval >= min(MIN_DOUBLE_CLICK_TIME, doubleClickTimeSetting / 5) &&
|
||||||
doubleClickInterval <= GetDoubleClickTime() &&
|
doubleClickInterval <= doubleClickTimeSetting &&
|
||||||
IsEqual(m_lastKeyPos, ptCursor))
|
IsEqual(m_lastKeyPos, ptCursor))
|
||||||
{
|
{
|
||||||
m_sonarState = SonarState::ControlDown2;
|
m_sonarState = SonarState::ControlDown2;
|
||||||
|
|||||||
Reference in New Issue
Block a user