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 10:08:13 PM(UTC)
Thaworn

Rank: Member

Reputation:

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

Thanks: 1 times
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 2:36:47 PM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 28 times
Was thanked: 419 time(s) in 356 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
Guest (2)
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.