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 : Wednesday, May 20, 2020 7:56:34 PM(UTC)
lyscop

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 4/23/2020(UTC)
Posts: 39
China

Thanks: 5 times
Was thanked: 1 time(s) in 1 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 9:57:18 AM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 636
United States

Thanks: 11 times
Was thanked: 143 time(s) in 125 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.
lyscop on 5/21/2020(UTC)
liuxilu  
#3 Posted : Thursday, May 21, 2020 10:44:53 AM(UTC)
liuxilu

Rank: Advanced Member

Reputation:

Groups: Moderators, Approved
Joined: 4/5/2020(UTC)
Posts: 67
China

Was thanked: 15 time(s) in 15 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 : Thursday, May 21, 2020 7:28:51 PM(UTC)
lyscop

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 4/23/2020(UTC)
Posts: 39
China

Thanks: 5 times
Was thanked: 1 time(s) in 1 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.
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.