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

Notification

Icon
Error

Options
Go to last post Go to first unread
lyscop  
#1 Posted : Thursday, May 21, 2020 1:56:34 AM(UTC)
soooulp

Rank: Advanced Member

Reputation:

Groups: Moderators, Approved
Joined: 4/23/2020(UTC)
Posts: 161
China

Thanks: 46 times
Was thanked: 23 time(s) in 17 post(s)
Hi Rob,

Now, I use code to divide the screen into Up/Down/Left/right and corners some different areas, so am I use code to judge different programs, which means I set many gestures, and some of them I use frequently, others I rarely use.

There is a problem that simple gestures are not enough to set the function. I realize that there is a page to show the gesture with the action in the S+ that previous edition, it is useful.

I will adjust the simple gesture to the action I use frequently if it can show the counts of every gesture I used.

UserPostedImage
Rob  
#2 Posted : Thursday, May 21, 2020 3:57:18 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)
This is a simple script which builds a list of all gestures and actions which includes the match counts. It could be expanded to save the gesture thumbnail image to a folder and create an HTML file instead for a more visual result - but that's alittle more complicated than I have the time for at the moment.

Code:
//Creates tab delimited format to paste into spreadsheet

//Setup column headings
var output = "Application\tAction\tButton\tGesture Name\tCount\r\n";

//First, just the overall match counts for each gesture, regardless of application/action
var gestures = sp_config.Gestures.Where(g => g.Active).OrderBy("MatchCount desc").ToArray();
for(i = 0; i < gestures.Length; i++)
{
    output += '\t\t\t' + gestures[i].Name + '\t' + gestures[i].MatchCount + '\r\n';
}

//Next, add rows for Global Actions
var globalActions = sp_config.GlobalApplication.Actions.Where(a => a.Active).OrderBy("MatchCount desc").ToArray();
for(i = 0; i < globalActions.Length; i++)
{
    output += 'Global Actions\t' + globalActions[i].Description  + '\t' + (globalActions[i].UseSecondaryStrokeButton ? 'Secondary' : 'Primary') + '\t' + globalActions[i].GestureName + '\t' + globalActions[i].MatchCount + '\r\n';
}

//Finally, each Application
var applications = sp_config.Applications.Where(a => a.Active).OrderBy("Description").ToArray();
for(i = 0; i < applications.Length; i++)
{
    var appName = applications[i].Description;
    var appActions = applications[i].Actions.Where(a => a.Active).OrderBy("MatchCount desc").ToArray();
    for(j = 0; j < appActions.Length; j++)
    {
        output += appName + '\t' + appActions[j].Description  + '\t' + (appActions[j].UseSecondaryStrokeButton ? 'Secondary' : 'Primary') + '\t' + appActions[j].GestureName + '\t' + appActions[j].MatchCount + '\r\n';
    }
}

//Put all rows on the clipboard to paste into spreadsheet
clip.SetText(output);
thanks 1 user thanked Rob for this useful post.
soooulp on 5/22/2020(UTC)
liuxilu  
#3 Posted : Thursday, May 21, 2020 4:44:53 PM(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)
That's great! I just not realized gestures have MatchCounts.
And I suggest encode images in a single html without other files.
lyscop  
#4 Posted : Friday, May 22, 2020 1:28:51 AM(UTC)
soooulp

Rank: Advanced Member

Reputation:

Groups: Moderators, Approved
Joined: 4/23/2020(UTC)
Posts: 161
China

Thanks: 46 times
Was thanked: 23 time(s) in 17 post(s)
Originally Posted by: Rob Go to Quoted Post
This is a simple script which builds a list of all gestures and actions which includes the match counts. It could be expanded to save the gesture thumbnail image to a folder and create an HTML file instead for a more visual result - but that's alittle more complicated than I have the time for at the moment.


Originally Posted by: liuxilu# Go to Quoted Post
That's great! I just not realized gestures have MatchCounts.
And I suggest encode images in a single HTML without other files.


Thank you Rob, it helps me a lot.

Liuxilu, it will clip all of the data in the clipboard now, could you expand it to create an HTML or other files.
Rob  
#5 Posted : Saturday, May 30, 2020 3:47:03 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)
This will create an HTML document on the clipboard. You can then paste it into a .html file. Could also modify the script to save the HTML file instead of putting it on the clipboard.

lyscop  
#6 Posted : Saturday, May 30, 2020 4:12:41 PM(UTC)
soooulp

Rank: Advanced Member

Reputation:

Groups: Moderators, Approved
Joined: 4/23/2020(UTC)
Posts: 161
China

Thanks: 46 times
Was thanked: 23 time(s) in 17 post(s)
Originally Posted by: Rob Go to Quoted Post
This will create an HTML document on the clipboard. You can then paste it into a .html file. Could also modify the script to save the HTML file instead of putting it on the clipboard.



Thank you so so much, Rob, it is more clearly.

UserPostedImage


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.