I see what you're looking to accomplish, but it is actually a very complicated thing to do - well, to do properly in a way where it is seamless and doesn't interfere with normal left/right mouse button operations.
For example:
Unless you wait for X milliseconds to see if the other button is going to be pressed, then the button press event will occur (meaning the app will see the left or right button was pressed down).
So then what happens? Do you also allow the up event to flow through?
Will the app not properly handle the panning action because it sees another mouse button is down?
Will it cause an unintentional thing to happen in the app since it saw a left or right mouse button down event? Even though you just want to ultimately send the middle button.
If you do wait for like 400ms on left or right button down to see if the other button will be pressed (e.g. consume the down event so the apps/Windows doesn't see the button press), you're going to start noticing that delay quickly when you're just trying to do normal things.
However, if you spend a little time getting used to this finger click sequence, I think you'll find it does what you need and is just as efficient.
1) Go to
Options > General and make sure
Rocker Support is checked.
2) Replace the previous script with this:
Code:// If the middle button was set as being held down
if(StrokesPlus.StoredValues.Booleans.Get("MiddleDown"))
{
// Set a value so this action can know what to do next Left click
// Clear this value since we're releasing the middle button
StrokesPlus.StoredValues.Booleans.Set("MiddleDown", false);
// Send the middle button up/release event
StrokesPlus.Input.Mouse.Button.Release(MouseButtons.Middle);
}
else
{
// Set a value so this action can know what to do next Left click
// Assign this value since we're starting the hold middle down
StrokesPlus.StoredValues.Booleans.Set("MiddleDown", true);
// Send the middle button down/hold event
StrokesPlus.Input.Mouse.Button.Hold(MouseButtons.Middle);
}
3) In your action's
Modifiers > Capture Modifiers dropdown, select
After.
4) Go to
Global Actions > Mouse Events > Release, check the
Enabled box (only, do not consume) and paste this script:
Code:// If the middle button was set as being held down
if(StrokesPlus.StoredValues.Booleans.Get("MiddleDown"))
{
// Set a value so this action can know what to do next Left click
// Clear this value since we're releasing the middle button
StrokesPlus.StoredValues.Booleans.Set("MiddleDown", false);
// Send the middle button up/release event
StrokesPlus.Input.Mouse.Button.Release(MouseButtons.Middle);
}
So now, to use this here's what you need to do:
- Press and hold the Right button down first
- Click the Left fully (down and up) while continuing to hold the Right button
- When you want to stop the panning, either click the Left button again OR just release the Right button
The above happens really fast, no need to wait - the main point is ensuring you strum your fingers so the right button is always the first button press
just before the left and keep the right down.
Obviously, make sure you don't move the mouse when you hold the right button until after you click the left button (otherwise S+ will try to recognize a gesture).
Note that if you click the
Left button to stop panning but continue to hold
Right down, S+ will still be capturing the mouse and you can click
Left again to start panning without releasing the
Right button. So you can keep toggling the middle button down and up this way - but all mouse button events will be captured (consumed) while the
Right button is down.
Edited by user Tuesday, July 5, 2022 3:50:49 AM(UTC)
| Reason: Not specified