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

Notification

Icon
Error

Options
Go to last post Go to first unread
flamingo  
#1 Posted : Wednesday, June 22, 2022 1:59:22 PM(UTC)
flamingo

Rank: Newbie

Reputation:

Groups: Approved
Joined: 6/19/2022(UTC)
Posts: 1
Germany

Thanks: 5 times
Is there a way to simply toggle enable/disable Strokesplus.net via a hotkey?

CTRL+SHIFT+WIN+Z was working with Strokesplus.com according to their website, but I cannot find the option for Strokesplus.net.

Clicking the tray icon works fine of course, but I'd really love a global hotkey, since my taskbar and hence the tray icon is not always visible due to my workflow.

Many thanks for this indispensable program, Rob :)


Rob  
#2 Posted : Wednesday, June 22, 2022 2:45:19 PM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 27 times
Was thanked: 378 time(s) in 328 post(s)
You can make a Hot Key in S+ and set to whatever key combination you want, then use the script below (don't check Unregistered):
Code:
if(StrokesPlus.Configuration.Settings.CaptureEnabled) {
    StrokesPlus.Program.Disable();
} else {
    StrokesPlus.Program.Enable();
}

However, make sure you go to Options > Advanced and check the box: Keeps Registered Hot Keys Active When Disabled
thanks 2 users thanked Rob for this useful post.
flamingo on 6/23/2022(UTC), randomConstant on 6/23/2022(UTC)
randomConstant  
#3 Posted : Thursday, June 23, 2022 5:24:15 AM(UTC)
randomConstant

Rank: Advanced Member

Reputation:

Groups: Translators, Approved
Joined: 7/17/2021(UTC)
Posts: 127

Thanks: 35 times
Was thanked: 16 time(s) in 13 post(s)
Thanks Rob

I have used this script to toggle S+ until now.
Code:
if(StrokesPlus.StoredValues.Booleans.Get("ProgramDisableFlag")) {
StrokesPlus.StoredValues.Booleans.Set("ProgramDisableFlag", false);
sp.CreateTimer('sPlusEnableTimer', 100, -1, String.raw`sp.Enable();sp.DeleteTimer('sPlusEnableTimer');`);
}else{
StrokesPlus.StoredValues.Booleans.Set("ProgramDisableFlag", true);
sp.Disable();
}

It works fine. But I wanted to try the new way because it is neat. It is giving me the following error when S+ is toggled ON.
Quote:
Unable to register hot key
Failed to register hotkey StrokePlus Gesture Hook Toggle
Hotkey is likely already registered by another process

unregistered is check OFF, and keep registered hot keys activewhen disabled is ON.
thanks 1 user thanked randomConstant for this useful post.
flamingo on 6/23/2022(UTC)
Rob  
#4 Posted : Thursday, June 23, 2022 1:52:49 PM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 27 times
Was thanked: 378 time(s) in 328 post(s)
Try adding sp.Sleep(500); to the end of the script above.

When a hot key is pressed, S+ disables the hot key internally (for a few reasons) and re-enables the hot key after the script completes execution.

The problem here is likely a race condition where sp.Enable() is going through and enabling any active hot keys which are not registered, while the hot key workflow is following up with its own logic that re-enables the hot key.

If that does resolve it for you, that will confirm my suspicion and I'll see about getting the logic updated.

Edit: Actually that may not make a difference, thinking about it again. I'll look around and see what I can find.

Edited by user Thursday, June 23, 2022 1:53:52 PM(UTC)  | Reason: Not specified

thanks 1 user thanked Rob for this useful post.
flamingo on 6/23/2022(UTC)
Rob  
#5 Posted : Thursday, June 23, 2022 2:08:23 PM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 27 times
Was thanked: 378 time(s) in 328 post(s)
Try version 0.5.6.9 and see if you still get the error popup.
thanks 1 user thanked Rob for this useful post.
flamingo on 6/23/2022(UTC)
randomConstant  
#6 Posted : Thursday, June 23, 2022 2:18:04 PM(UTC)
randomConstant

Rank: Advanced Member

Reputation:

Groups: Translators, Approved
Joined: 7/17/2021(UTC)
Posts: 127

Thanks: 35 times
Was thanked: 16 time(s) in 13 post(s)
Adding delays did not resolve the issue.

Newer version (0.5.6.9) resolved the issue.

Thanks Rob Laugh
thanks 2 users thanked randomConstant for this useful post.
Rob on 6/23/2022(UTC), flamingo on 6/23/2022(UTC)
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.