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

Notification

Icon
Error

Options
Go to last post Go to first unread
Theinvoker  
#1 Posted : Saturday, August 15, 2020 1:58:38 AM(UTC)
Theinvoker

Rank: Member

Reputation:

Groups: Approved
Joined: 3/24/2020(UTC)
Posts: 29
Italy
Location: Milano

Thanks: 2 times
I need to use a secondary button to do that gesture you told me to control volume (Button+ Scroll Wheel)
Sometimes i have to use mouse with my left hand and it's more comfortable if that gesture is Left Button + Scroll Wheel instead of the primary Right Button.

But i need Left Button only for that gesture and i don't want secondary button to be always active. i use left click to move video players (and windows in general when they are not maximized) but if i set left click as secondary button then it always try to do some gesture and it moves windows only when i release buttons
Rob  
#2 Posted : Wednesday, August 19, 2020 6:06:52 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)
You can use the Left Click and Mouse Wheel events to handle this.

Global Actions > Mouse Events > Left Click

Check Enabled, leave Consume unchecked
Code:
//On left button down store a variable that the Mouse Wheel script looks for, on release delete it
if(click.Down) {
    sp.StoreBool("VolumeScrollActive", true)
} else {
    sp.DeleteStoredBool("VolumeScrollActive")
}


Global Actions > Mouse Events > Mouse Wheel
Code:
//If variable from Left Click script is set, the left button is down, so change volume
if(sp.GetStoredBool("VolumeScrollActive")) {
    //wheel.Delta is a positive or negative number, indicating the direction the wheel was scrolled
    if(wheel.Delta > 0) {
        sp.SendVKey(vk.VOLUME_UP);
    } else {
        sp.SendVKey(vk.VOLUME_DOWN);
    }
}
Thaworn  
#3 Posted : Thursday, October 15, 2020 4:15:12 AM(UTC)
Thaworn

Rank: Newbie

Reputation:

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

The mouse wheel is not working after done that.

How to make the default mouse wheel available?
Rob  
#4 Posted : Thursday, October 15, 2020 6:07:03 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)
Just have it inject the mouse wheel if it's not in the volume logic.

Code:
//If variable from Left Click script is set, the left button is down, so change volume
if(sp.GetStoredBool("VolumeScrollActive")) {
    //wheel.Delta is a positive or negative number, indicating the direction the wheel was scrolled
    if(wheel.Delta > 0) {
        sp.SendVKey(vk.VOLUME_UP);
    } else {
        sp.SendVKey(vk.VOLUME_DOWN);
    }
} else {
    //Not in volume logic, relay the mouse wheel event
    sp.MouseWheel(wheel.Point, false, wheel.Delta);
}
Thaworn  
#5 Posted : Thursday, October 15, 2020 4:17:51 PM(UTC)
Thaworn

Rank: Newbie

Reputation:

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

One more question.

How to set the different action on left mouse button+Mouse wheel?
Rob  
#6 Posted : Friday, October 16, 2020 6:25:56 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)
Originally Posted by: Thaworn Go to Quoted Post
One more question.

How to set the different action on left mouse button+Mouse wheel?

Just change the code inside the first block:
Code:
//If variable from Left Click script is set, the left button is down, so change volume
if(sp.GetStoredBool("VolumeScrollActive")) {
    //wheel.Delta is a positive or negative number, indicating the direction the wheel was scrolled
    if(wheel.Delta > 0) {
        //TODO: Wheel scrolled up, do something here
    } else {
        //TODO: Wheel scrolled down, do something here
    }
} else {
    //Not in volume logic, relay the mouse wheel event
    sp.MouseWheel(wheel.Point, false, wheel.Delta);
}
Thaworn  
#7 Posted : Saturday, October 24, 2020 1:54:52 PM(UTC)
Thaworn

Rank: Newbie

Reputation:

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

I mean different action for another application/program.

(Sorry, I didn't ask you clearly.)

Rob  
#8 Posted : Sunday, October 25, 2020 8:37:54 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)
You can use similar logic to what I posted to your other request:

https://forum.strokesplus.net/posts/m11602-How-to-change-stroke-button-on-specific-application
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.