Skip to content

Commit

Permalink
Properly swap mouse button 2 and 3
Browse files Browse the repository at this point in the history
The previous commit (fa83b90)
mistakenly only swapped the buttons for `doubleclick`.
  • Loading branch information
lesderid committed Dec 23, 2021
1 parent fa83b90 commit a4aedff
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/keynavish/commands.d
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit a4aedff

Please sign in to comment.