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

Notification

Icon
Error

Options
Go to last post Go to first unread
alloys  
#1 Posted : Tuesday, May 21, 2024 6:12:19 AM(UTC)
alloys

Rank: Newbie

Reputation:

Groups: Approved
Joined: 2/11/2023(UTC)
Posts: 7
China

Have a question and an idea to see if it can be done
The basic principle of gestures is to detect the distance of the mouse slide to activate the corresponding setting
The same gesture is currently directly corresponding to one result
Can you add a distance detection function, such as sliding to activate one configuration within 150 and greater than 150 to activate another function (this distance allows the user to configure itself according to the screen size of the word and daily usage habits)
This can greatly expand the function of the gesture
Or is it already available, but I haven't found it
The building Lord can help to answer
thanks
Rob  
#2 Posted : Tuesday, May 21, 2024 1:40:53 PM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 28 times
Was thanked: 425 time(s) in 360 post(s)
You can do something like this in an action script.

This gets the distance from where the gesture started and ended, then does one thing for less than 150 distance and something else for 150 or larger.

Code:
//the distance between the gesture start and end points, not the length of the line itself
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)));

if(distance < 150) {
    //do something for < 150 distance
} else{
    //do something for >= 150 distance
}

But you can also just check along a single axis (X or Y) by calculating the distance from action.Start.X to action.End.X
alloys  
#3 Posted : Wednesday, May 22, 2024 7:51:23 AM(UTC)
alloys

Rank: Newbie

Reputation:

Groups: Approved
Joined: 2/11/2023(UTC)
Posts: 7
China

Thanks to Rob for the reply and guidance, and another question
I want to add an action boost, but it seems that only in topleft,top,topright,right,bottomright,bottom,bottomleft,left, 8 positions, can be displayed in the center of the screen, or follow the mouse
Rob  
#4 Posted : Thursday, May 23, 2024 2:05:10 PM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 28 times
Was thanked: 425 time(s) in 360 post(s)
What do you mean by "action boost"?
alloys  
#5 Posted : Friday, May 24, 2024 9:33:58 AM(UTC)
alloys

Rank: Newbie

Reputation:

Groups: Approved
Joined: 2/11/2023(UTC)
Posts: 7
China

What I mean is the location of the prompt information, it seems that there are only 8 locations, there is no screen center or follow the mouse display option
Rob  
#6 Posted : Friday, May 24, 2024 1:23:41 PM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 28 times
Was thanked: 425 time(s) in 360 post(s)
Are you referring to the Hints? The popup that displays when you start to draw a gesture?
alloys  
#7 Posted : Friday, May 24, 2024 1:33:57 PM(UTC)
alloys

Rank: Newbie

Reputation:

Groups: Approved
Joined: 2/11/2023(UTC)
Posts: 7
China

I mean the pop-up window(info.Location = "top";)


var info = new DisplayTextInfo();
info.TitleFont = new Font('Segoe UI', 10, host.flags(FontStyle.Bold));
info.MessageFont = new Font("Segoe UI Semibold", 72);
info.ForeColor = "255,255,255";
info.Duration = 1000;
info.Location = "top";//类型:topleft,top,topright,right,bottomright,bottom,bottomleft,left
info.Padding = 10;
info.BackColor = "37,146,52";
//the distance between the gesture start and end points, not the length of the line itself
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)));

if(distance < 280) {
//do something for < 150 distance
sp.SendModifiedVKeys([vk.LCONTROL,vk.LMENU,vk.LSHIFT], [vk.LEFT]);
info.Message = "上一曲";
sp.DisplayText(info);
} else{
//do something for >= 150 distance
sp.SendModifiedVKeys([vk.LCONTROL,vk.LMENU], [vk.F4]);
sp.Sleep(500);
sp.Run('https://www.zomoplan.com/web/view');
info.Message = "工作清单";
sp.DisplayText(info);
}

Rob  
#8 Posted : Friday, May 24, 2024 2:28:13 PM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 28 times
Was thanked: 425 time(s) in 360 post(s)
Try this - you will have to adjust the top and left some, since we don't know the actual size of the info popup, but this should work pretty well.
Code:
//Get center of screen and adjust some for the info
var screenArea = action.Window.Screen.WorkingArea;
var left = parseInt(screenArea.Width / 2) - 200;
var top = parseInt(screenArea.Height / 2) - 100;
var infoloc = `${left},${top}`;
//StrokesPlus.Console.Log(infoloc);

var info = new DisplayTextInfo();
info.TitleFont = new Font('Segoe UI', 10, host.flags(FontStyle.Bold));
info.MessageFont = new Font("Segoe UI Semibold", 72);
info.ForeColor = "255,255,255";
info.Duration = 1000;
info.Location = infoloc;//类型:topleft,top,topright,right,bottomright,bottom,bottomleft,left
info.Padding = 10;
info.BackColor = "37,146,52";
//the distance between the gesture start and end points, not the length of the line itself
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)));

if(distance < 280) {
//do something for < 150 distance
sp.SendModifiedVKeys([vk.LCONTROL,vk.LMENU,vk.LSHIFT], [vk.LEFT]);
info.Message = "上一曲";
sp.DisplayText(info);
} else{
//do something for >= 150 distance
sp.SendModifiedVKeys([vk.LCONTROL,vk.LMENU], [vk.F4]);
sp.Sleep(500);
sp.Run('https://www.zomoplan.com/web/view');
info.Message = "工作清单";
sp.DisplayText(info);
}
alloys  
#9 Posted : Saturday, May 25, 2024 4:42:40 AM(UTC)
alloys

Rank: Newbie

Reputation:

Groups: Approved
Joined: 2/11/2023(UTC)
Posts: 7
China

Thanks to Rob's reply, it is now perfectly displayed
misaki4650  
#10 Posted : Thursday, June 13, 2024 7:50:52 PM(UTC)
misaki4650

Rank: Member

Reputation:

Groups: Approved
Joined: 2/21/2021(UTC)
Posts: 17
Japan
Location: nagano

Thanks: 16 times
Was thanked: 1 time(s) in 1 post(s)
That's a Good IdeaLaugh
https://i.imgur.com/h9k2KL9.mp4
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.