StrokesPlus.net
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
dirtyacc  
#1 Posted : Saturday, December 7, 2019 6:38:39 PM(UTC)
dirtyacc

Rank: Newbie

Reputation:

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
Rob  
#2 Posted : Sunday, December 8, 2019 7:37:35 AM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 506
United States

Thanks: 5 times
Was thanked: 99 time(s) in 86 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;
}
thanks 1 user thanked Rob for this useful post.
dirtyacc on 12/9/2019(UTC)
dirtyacc  
#3 Posted : Monday, December 9, 2019 12:22:52 AM(UTC)
dirtyacc

Rank: Newbie

Reputation:

Groups: Approved
Joined: 12/7/2019(UTC)
Posts: 2

Thanks: 1 times
Originally Posted by: Rob Go to Quoted Post
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
Users browsing this topic
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.