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

Notification

Icon
Error

Options
Go to last post Go to first unread
Phred d'Elder  
#1 Posted : Saturday, April 30, 2022 4:23:20 PM(UTC)
Phred d'Elder

Rank: Newbie

Reputation:

Groups: Approved
Joined: 4/29/2022(UTC)
Posts: 2
United States
Location: Michigan

Greetings. I was introduced to this app by the CTRL+PAINT posting in their free video library (https://www.ctrlpaint.com/videos/gesture-shortcuts-pt1). It makes reference to the previous incarnation of this product, but it still seems like it will be relevant in the current build. In the video, he mentions that he has a key enabled that activates the gesture action using his stylus. I am drawing with a Wacom Bamboo pad and am also using a TourBox controller for making various adjustments during a session. What I would like to know: is it possible to generate a gesture without needing to press (any) mouse button, to assign a keyboard stroke (one or more keys pressed at one time...this is how the various controllers on the TourBox interact, by sensing a use and generating the corresponding keyboard strokes) to tell the program to look for a gesture.

I have spent some time searching the forum and site pages (and general Google searches as well) and have not found an answer....

If it is a current feature, please describe how to enable such a key setup (or link to the relevant earlier answer). If not, then I would suggest that this be placed into consideration for future release.


Thanks. I have found the app to be quite useful for general computer use as it is, but the ability to adapt it to my art work flow would make it a great tool for my other activities as well.

Phred.
Rob  
#2 Posted : Saturday, April 30, 2022 8:10:41 PM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 28 times
Was thanked: 419 time(s) in 356 post(s)
It's not a documented feature, as it can be prone to instability, and I haven't really tested it a lot - but you can make a regular hot key in S+ (just check Active, not any others)

This script is if you only had a single key (F1 in this example) as the hot key definition:
Code:
// For just F1 as Hot Key
if(!sp.GetStoredBool("StrokeDown")) {
    sp.StoreBool("StrokeDown", true);
    sp.StoreNumber("CancelDelay", sp_config.CancelDelay);
    sp_config.CancelDelay = System.Int32.MaxValue;
    sp.StartManualCapture(false);
    sp.CreateTimer("StrokeTimer", 
                   10, 
                   50, 
                   `if(!StrokesPlus.Input.Keyboard.Keys.IsDown(vk.F1)) {  // << key not down
                        sp.StopManualCapture();
                        sp_config.CancelDelay = sp.GetStoredNumber("CancelDelay");
                        sp.DeleteStoredBool("StrokeDown");
                        sp.DeleteTimer("StrokeTimer");
                    }
                   `);
}

This is if you used Alt+F1 (left Alt):
Code:
// For Alt + F1 as Hot Key
if(!sp.GetStoredBool("StrokeDown")) {
    sp.StoreBool("StrokeDown", true);
    sp.StoreNumber("CancelDelay", sp_config.CancelDelay);
    sp_config.CancelDelay = System.Int32.MaxValue;
    sp.StartManualCapture(false);
    sp.CreateTimer("StrokeTimer", 
                   10, 
                   50, 
                   `if(!StrokesPlus.Input.Keyboard.Keys.IsDown(vk.LMENU)  // << key not down
                       && !StrokesPlus.Input.Keyboard.Keys.IsDown(vk.F1))  // << and this key not down
                    {
                        sp.StopManualCapture();
                        sp_config.CancelDelay = sp.GetStoredNumber("CancelDelay");
                        sp.DeleteStoredBool("StrokeDown");
                        sp.DeleteTimer("StrokeTimer");
                    }
                   `);
}

What this does is tell S+ to pretend you pressed down the stroke button (e.g. right mouse button) - everything else behaves no differently than if you held the right mouse button.

The only exception is that in the script, I'm setting the CacnelDelay (timeout) to the max value, since it seems allowing the gesture to timeout in this scenario messes up the S+ state and gestures stop working.

The value here sp.StartManualCapture(false); (false / true indicates if you want to simulate the primary stroke button, or the secondary.
false means you're simulating the primary, true means secondary.

So you could have two hot keys, with the extra one passing true - then you could make an action and check use secondary and the second hotkey would be what triggers the secondary actions.

Hopefully this makes sense!
thanks 1 user thanked Rob for this useful post.
Angel on 11/6/2022(UTC)
Phred d'Elder  
#3 Posted : Friday, May 6, 2022 1:25:19 PM(UTC)
Phred d'Elder

Rank: Newbie

Reputation:

Groups: Approved
Joined: 4/29/2022(UTC)
Posts: 2
United States
Location: Michigan

i must be missing something...or else Windows 11 has a compatibility issue. i tried copy and paste this script into a hot-key link but it (and the sample in the app) does nothing... will keep trying. thank you for the help
Rob  
#4 Posted : Friday, May 6, 2022 3:10:24 PM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 28 times
Was thanked: 419 time(s) in 356 post(s)
I'm running Windows 11, so it's definitely not a compatibility issue.

You can add lines to log to the Console window (User tab) to help troubleshoot - like put at the top, middle, end of your script(s) to see if the code is being reached, etc.
Code:
StrokesPlus.Console.Log("some message");

You can also send me you StrokesPlus config (full Export from Import/Export section) and I can see if anything stands out - rob@strokesplus.net
Users browsing this topic
Guest
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.