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

Notification

Icon
Error

Options
Go to last post Go to first unread
Thaworn  
#1 Posted : Thursday, October 15, 2020 4:08:13 PM(UTC)
Thaworn

Rank: Newbie

Reputation:

Groups: Approved
Joined: 8/8/2020(UTC)
Posts: 8
Thailand

I want to change stroke button from right mouse button to middle mouse button when using chrome. How could I do that?
Rob  
#2 Posted : Sunday, October 25, 2020 8:36:47 AM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 718
United States
Location: Tampa, FL

Thanks: 14 times
Was thanked: 163 time(s) in 141 post(s)
Put one of these scripts in the following tab:

Global Actions > Window Events > Foreground Window Change

Code:
//This uses less resources, but may conflict if another 
//window title has the text below in it
if(sp.ForegroundWindow().Title.indexOf("- Google Chrome") > -1) {
    sp_config.StrokeButton = MouseButtons.Middle;
} else {
    sp_config.StrokeButton = MouseButtons.Right;
}

Or:
Code:
//This should always work, but uses a more resources
var regex = /.*chrome\.exe/;
var exeName = sp.ForegroundWindow().Process.MainModule.ModuleName;
if(regex.exec(exeName)) {
    sp_config.StrokeButton = MouseButtons.Middle;
} else {
    sp_config.StrokeButton = MouseButtons.Right;
}
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.