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

Notification

Icon
Error

Options
Go to last post Go to first unread
2014218866  
#1 Posted : Sunday, December 29, 2019 10:44:21 AM(UTC)
2014218866

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 5/6/2019(UTC)
Posts: 111
China

Thanks: 19 times
Was thanked: 1 time(s) in 1 post(s)
Dear Rob,

when I use the right button as the mouse gesture key, the right-click script will not work. As a new feature, can s + enable right-click scripting (if this feature causes an exception, S + can also limit the time of clicking). Also we consider enabling wheel key click scripts when the wheel key is used as a secondary gesture key.

I look forward to your reply.
Rob  
#2 Posted : Monday, December 30, 2019 1:41:58 PM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 28 times
Was thanked: 416 time(s) in 354 post(s)
I've made an update in 0.3.7.6 to allow this. However, only the button Down event is triggered in the click script, you will have to use the Release script to handle the button Up event.

Right Click
Code:
//Right Click script
if(click.Down) {
    sp.MessageBox("Down", "Down");
} else {
    //Up event, this will never happen for stroke buttons
    //Use Release tab
}


Release
Code:
//Release script
if(click.Button == MouseButtons.Right) {
    //There is no Down event for the Release event
    sp.MessageBox("Up", "Up");
}
2014218866  
#3 Posted : Monday, December 30, 2019 3:37:13 PM(UTC)
2014218866

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 5/6/2019(UTC)
Posts: 111
China

Thanks: 19 times
Was thanked: 1 time(s) in 1 post(s)
Thank you for improving S +, Rob.
Now I have a problem. In word.exe, I want to realize such a function: select text continuously by X1 (after X1 click, Ctrl is pressed), and change font color by drawing "V" with the right mouse button (release Ctrl by right clicking the script at the same time). But when S + executes the latter, it will cancel the selected text and cannot change the font color. I don't know how to avoid this situation. Can you help me?

Here is the X1 script


Code:
if(!click.Down) {
    //If Control is down from previous click
    if(sp.GetStoredBool("ControlDown")) {
        sp.SendControlUp();
        sp.DeleteStoredBool("ControlDown");
    } else {
        //First click, send control down
        sp.StoreBool("ControlDown", true); 
        sp.SendControlDown();
    }
}


Right click script

Code:
 if(click.Down) {
//   If Control or Shift is down from previous click
    if(sp.GetStoredBool("ControlDown")) {
        sp.SendControlUp();
       sp.DeleteStoredBool("ControlDown");}
}



Script of changing font color in word

Code:
sp.SendAltDown()
sp.SendKeys("h")
sp.SendAltUp()
sp.SendString('i');
var distance = parseInt(Math.sqrt(Math.pow((action.End.X - action.Start.X), 2.0) + Math.pow((action.End.Y - action.Start.Y), 2.0)));
//the distance between the gesture start and end points,not the length of the line itself

if(distance < 30) {
sp.SendKeys("{ENTER}")
} else{
sp.SendKeys("{Left}")
sp.SendKeys("{Left}")
sp.SendKeys("{ENTER}")
}
//sp.MessageBox(distance, "Total Distance");

Rob  
#4 Posted : Monday, December 30, 2019 6:05:23 PM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 28 times
Was thanked: 416 time(s) in 354 post(s)
I tried your scripts and it worked fine for me.

But note that for the V (change color) action, I had to have Control as the modifier for the action, since the Control key is being held down after pressing X1.

2014218866  
#5 Posted : Wednesday, January 1, 2020 11:58:37 PM(UTC)
2014218866

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 5/6/2019(UTC)
Posts: 111
China

Thanks: 19 times
Was thanked: 1 time(s) in 1 post(s)
Hi, Rob..
Thank you for your reply. Now I use the wheel as the secondary gesture key, but you know that the wheel key has a good function. When it is pressed and dragged down, the page to be viewed will turn down. I want to know whether S + can realize the default function of the mouse wheel key in the global gesture when it is used as the secondary gesture key. For example, in Google, the function of scrolling down an arrow is the same as when it is not used as a secondary gesture key, that is, the page scrolls down.
If this function cannot be realized in the global gesture, can s + realize the following function. In S +, when the scroll wheel draws a V, S + performs the copy function (only this gesture uses the scroll wheel as the secondary gesture key, and other gestures use the right key as the gesture key). However, when the wheel does not draw V (any other shape), the S + wheel key performs the default function of the mouse.
Rob  
#6 Posted : Thursday, January 2, 2020 2:32:51 PM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 28 times
Was thanked: 416 time(s) in 354 post(s)
Unfortunately that is not something which can be reasonably accomplished within S+ in a way that doesn't have complications. There's no way to know the user's intention in advance, and Chrome reacts immediately to the button being held down.

However, single-pressing the middle (wheel) does toggle a scrolling mode in Chrome, then you simply press the button again to exit the scrolling mode. Yes, it is not exactly the same, but is pretty close.

There might be some overly complicated way to make this somewhat work, but it's not something I will add to S+ itself as it's a very specific use case and one that feels like it will be problematic and/or confusing to implement as well as convey to users.

But, if you enable your middle click script and release scripts, I think you can accomplish this with the following scripts. However, the page will scroll while you're drawing.

Middle Click Script
Code:
sp.MouseClick(click.Point, click.Button, true, false); //Send only middle mouse button Down


Release Script
Code:
if(click.Button == MouseButtons.Middle) {
    sp.MouseClick(click.Point, click.Button, false, true); //Send middle mouse button Up
}

2014218866  
#7 Posted : Friday, January 3, 2020 3:34:25 AM(UTC)
2014218866

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 5/6/2019(UTC)
Posts: 111
China

Thanks: 19 times
Was thanked: 1 time(s) in 1 post(s)
Thank you for your reply, Rob
Your script is very easy to use and is suitable for my computer. There is no need for you to make improvements to S +. Thank you again.
zyxi  
#8 Posted : Saturday, April 11, 2020 1:26:44 PM(UTC)
zyxi

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 3/30/2019(UTC)
Posts: 74
China

Thanks: 8 times
Was thanked: 1 time(s) in 1 post(s)
Dear friends, I also want to know whether the following gesture can perform the original mouse wheel function.
For example, this gesture can make the page scroll down in word (S + does not need to enable Middle Click Script).
Who can help me answer this question? Thank you very much for your help..



UserPostedImage
liuxilu  
#9 Posted : Sunday, April 12, 2020 3:06:40 AM(UTC)
liuxilu

Rank: Advanced Member

Reputation:

Groups: Translators, Moderators, Approved
Joined: 4/6/2020(UTC)
Posts: 79
China

Thanks: 1 times
Was thanked: 21 time(s) in 21 post(s)
见脚本帮助->鼠标->MouseWheel
zyxi  
#10 Posted : Tuesday, April 14, 2020 11:09:46 AM(UTC)
zyxi

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 3/30/2019(UTC)
Posts: 74
China

Thanks: 8 times
Was thanked: 1 time(s) in 1 post(s)
If you think this is very simple, you can try whether it can achieve the effect I mentioned above, and still thank you for your reply.
zyxi  
#11 Posted : Tuesday, April 14, 2020 11:18:19 AM(UTC)
zyxi

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 3/30/2019(UTC)
Posts: 74
China

Thanks: 8 times
Was thanked: 1 time(s) in 1 post(s)
In S +, I use the scroll wheel as a secondary gesture key, but in addition to the gestures I defined, I want to implement the original scroll key function, such as turning down the page in the browser and dragging down through the scroll wheel.
zyxi  
#12 Posted : Tuesday, April 14, 2020 11:26:34 AM(UTC)
zyxi

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 3/30/2019(UTC)
Posts: 74
China

Thanks: 8 times
Was thanked: 1 time(s) in 1 post(s)
UserPostedImage

There is a problem with the above method, it will make the secondary gesture keys of S + not work in some software such as CAD, or Mindmanager.exe, etc. (they have a common feature that is to use the wheel key to drive a specific function)
Rob  
#13 Posted : Friday, April 17, 2020 12:19:04 PM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 28 times
Was thanked: 416 time(s) in 354 post(s)
Right, you're sending the middle down on click with middle defined as a stroke button, so trying to draw a gesture will result in the applications seeing the middle button down.

So first, you would probably need to exclude those applications in your script, so it doesn't send the middle click for those applications.

Second, you should make sure to send the middle click up event in the Release tab (if you haven't already), otherwise Windows/applications will still think the middle button is pressed.
2014218866  
#14 Posted : Friday, April 17, 2020 12:48:29 PM(UTC)
2014218866

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 5/6/2019(UTC)
Posts: 111
China

Thanks: 19 times
Was thanked: 1 time(s) in 1 post(s)
Therefore, it is certain that when the scroll wheel draws a 1 gesture, S + cannot perform the copy function in word, but in other software such as IE, Excel performs the original scroll wheel function, right?
2014218866  
#15 Posted : Friday, April 17, 2020 12:50:33 PM(UTC)
2014218866

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 5/6/2019(UTC)
Posts: 111
China

Thanks: 19 times
Was thanked: 1 time(s) in 1 post(s)
Please forgive me for interrupting your conversation
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.