StrokesPlus.net Forum
»
General Discussion
»
Feature Requests
»
enable/disable secondary button base on the foreground program
Rank: Newbie
Groups: Approved
Joined: 12/7/2019(UTC) Posts: 2
Thanks: 1 times
|
I can't use right click gesture in app1. And I can't use middle button gesture in app2... I want an option that automatic switch on/off secondary button recognition based on the preset program rule. then i can use middle button for app1 & keep app2 native middle button works, and both program have gestures
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,359 Location: Tampa, FL Thanks: 28 times Was thanked: 419 time(s) in 356 post(s)
|
Here's a simple example which can be modified however you need. Enable the Global Actions > Window Events > Foreground Window Change script. Valid options for the stroke buttons are: - MouseButtons.Left
- MouseButtons.Middle
- MouseButtons.Right
- MouseButtons.XButton1
- MouseButtons.XButton2
- MouseButtons.None
Code://See if the window's title has '- Google Chrome' in the text
//if so, set the primary/secondary stroke buttons to something for Chrome
//otherwise (else) set the stroke buttons to the default
if(sp.ForegroundWindow().Title.indexOf("- Google Chrome") > -1) {
sp_config.StrokeButton = MouseButtons.Right;
sp_config.SecondaryStrokeButton = MouseButtons.Middle;
} else {
sp_config.StrokeButton = MouseButtons.Middle;
sp_config.SecondaryStrokeButton = MouseButtons.Right;
}
|
1 user thanked Rob for this useful post.
|
|
|
Rank: Newbie
Groups: Approved
Joined: 12/7/2019(UTC) Posts: 2
Thanks: 1 times
|
Originally Posted by: Rob Here's a simple example which can be modified however you need. Enable the Global Actions > Window Events > Foreground Window Change script. Valid options for the stroke buttons are: - MouseButtons.Left
- MouseButtons.Middle
- MouseButtons.Right
- MouseButtons.XButton1
- MouseButtons.XButton2
- MouseButtons.None
Code://See if the window's title has '- Google Chrome' in the text
//if so, set the primary/secondary stroke buttons to something for Chrome
//otherwise (else) set the stroke buttons to the default
if(sp.ForegroundWindow().Title.indexOf("- Google Chrome") > -1) {
sp_config.StrokeButton = MouseButtons.Right;
sp_config.SecondaryStrokeButton = MouseButtons.Middle;
} else {
sp_config.StrokeButton = MouseButtons.Middle;
sp_config.SecondaryStrokeButton = MouseButtons.Right;
}
work as a charm. thanks
|
|
|
|
StrokesPlus.net Forum
»
General Discussion
»
Feature Requests
»
enable/disable secondary button base on the foreground program
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The StrokesPlus.net Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close