From a4aedff6fc68a512bacffe576ee6276bb19ecf90 Mon Sep 17 00:00:00 2001 From: Les De Ridder Date: Thu, 23 Dec 2021 02:58:34 +0100 Subject: [PATCH] Properly swap mouse button 2 and 3 The previous commit (fa83b90c103f906370a9bd9a9dcfe7c5be00ad30) mistakenly only swapped the buttons for `doubleclick`. --- src/keynavish/commands.d | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/keynavish/commands.d b/src/keynavish/commands.d index 8c70b28..3e1f55e 100644 --- a/src/keynavish/commands.d +++ b/src/keynavish/commands.d @@ -260,13 +260,13 @@ private void click(string button) inputs[1].mi.dwFlags = MOUSEEVENTF_LEFTUP; break; case "2": - inputs[0].mi.dwFlags = MOUSEEVENTF_RIGHTDOWN; - inputs[1].mi.dwFlags = MOUSEEVENTF_RIGHTUP; - break; - case "3": inputs[0].mi.dwFlags = MOUSEEVENTF_MIDDLEDOWN; inputs[1].mi.dwFlags = MOUSEEVENTF_MIDDLEUP; break; + case "3": + inputs[0].mi.dwFlags = MOUSEEVENTF_RIGHTDOWN; + inputs[1].mi.dwFlags = MOUSEEVENTF_RIGHTUP; + break; case "4": inputs[0].mi.dwFlags = MOUSEEVENTF_WHEEL; inputs[0].mi.mouseData = WHEEL_DELTA; @@ -336,10 +336,10 @@ private void drag(string button, string modifiers) mouseInput.mi.dwFlags = !draggingFlag ? MOUSEEVENTF_LEFTDOWN : MOUSEEVENTF_LEFTUP; break; case "2": - mouseInput.mi.dwFlags = !draggingFlag ? MOUSEEVENTF_RIGHTDOWN : MOUSEEVENTF_RIGHTUP; + mouseInput.mi.dwFlags = !draggingFlag ? MOUSEEVENTF_MIDDLEDOWN : MOUSEEVENTF_MIDDLEUP; break; case "3": - mouseInput.mi.dwFlags = !draggingFlag ? MOUSEEVENTF_MIDDLEDOWN : MOUSEEVENTF_MIDDLEUP; + mouseInput.mi.dwFlags = !draggingFlag ? MOUSEEVENTF_RIGHTDOWN : MOUSEEVENTF_RIGHTUP; break; default: showError("Invalid mouse button: " ~ button);