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

Notification

Icon
Error

Options
Go to last post Go to first unread
adyy  
#1 Posted : Saturday, August 31, 2019 8:53:06 AM(UTC)
adyy

Rank: Member

Reputation:

Groups: Approved
Joined: 8/25/2019(UTC)
Posts: 20
China

Was thanked: 1 time(s) in 1 post(s)
Hi, Rob. Thank you for creating S+, a great software.
I have an idea,Can you add a setting, that S+ can be activated by holding down a key when on a ignore software.

Rob  
#2 Posted : Saturday, August 31, 2019 12:52:18 PM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 5 times
Was thanked: 96 time(s) in 83 post(s)
That would add a bit of complexity to the workflow.

Can you give me an example situation? I believe an alternative approach can be achieved using existing functionality.
adyy  
#3 Posted : Saturday, August 31, 2019 7:04:25 PM(UTC)
adyy

Rank: Member

Reputation:

Groups: Approved
Joined: 8/25/2019(UTC)
Posts: 20
China

Was thanked: 1 time(s) in 1 post(s)
Sometimes, users may need to perform global actions on Ignore App window.
It would be great if strokes could be temporarily activated at this time, , such as by holding down a hotkey.
For example, on the Ignore App window of Firefox, I want to perform some global gestures, such as opening a folder or moving the Firefox window to another monitor,etc.


Rob  
#4 Posted : Saturday, August 31, 2019 7:14:29 PM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 5 times
Was thanked: 96 time(s) in 83 post(s)
So what is the reason you're ignoring Firefox?

I'm just trying to get all of the information so I can consider the options.
adyy  
#5 Posted : Saturday, August 31, 2019 7:28:23 PM(UTC)
adyy

Rank: Member

Reputation:

Groups: Approved
Joined: 8/25/2019(UTC)
Posts: 20
China

Was thanked: 1 time(s) in 1 post(s)
I Ignore Firefox and Chrome browsers, they all have some good mouse gesture plug-ins to use, which is more convenient.
Rob  
#6 Posted : Sunday, September 1, 2019 6:49:40 AM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 5 times
Was thanked: 96 time(s) in 83 post(s)
How many gestures do you have configured in the browsers?

Also, what are the names of the browser gesture plug-ins?

The reason I'm asking is because you can relay a gesture. Someone in the original S+ had the same situation with Firegestures (I think that was the name).
Basically, they created the actions for Firefox (in S+, so the action definitions matched the ones in Firegestures) and relayed the gesture.

For example, you have an L gesture in the browser, you make a Firefox app and action which has L as the gesture and for the script:
Code:
sp.RelayGesture(action.GesturePoints, action.StrokeButton);


So S+.net is still capturing the gesture, but it just relays (replays) it so the browser plug-in receives it. So that is an option.

The problem with adding a key to disable ignore is not that it's extremely difficult to do, it's that it would introduce some very confusing conditions and complicated logic resulting in state management issues and gesture/action determination uncertainty.

For example:
  • You have a global action with a Control modifier and L gesture
  • You have another global action with no modifier, but uses the L gesture as well
  • Let's say this feature to temporarily disable ignore used the Control key in this example
  • So you're in Firefox and press the Control key to allow S+ to capture the mouse and draw an L
  • S+ knows that you're holding the Control key to allow the gesture in Firefox, but it cannot know if you want the Control key as a modifier or not, so it would always fire the Control+L action....unless you made the action Capture Modifiers as After. But even then, you could have another global action which had Control+L and Before or Either for Capture Modifiers, and that one would win every time.

This gets more complicated with the Disable S+ if this App Gains Focus checkbox for an ignored application, if the app already gained focus, S+ is disabled and won't capture the mouse, so it can't watch for the Control key. If it wasn't the foreground window, but you drew a gesture over the window, the logic would also need to check the Control key to not ignore it, but in separate code (when foreground window changes), that code would then disable S+.

S+ is already complex and, I'm sure to some, confusing enough as it is; adding yet another layer of complexity only exacerbates this. Plus, the above example with the modifiers is not deterministic...at least not without adding a whole new set of specific logic under this specific scenario. It essentially would result in multiple separate decision trees in multiple places of code that would be difficult to maintain and even more difficult to represent within the user interface. Or only allow temporary ignore disable keys which cannot be modifiers, but that would not likely be very ideal for a whole separate list of reasons.

These reasons are why I'm trying to find an alternative solution, as I honestly do not want to create a feature which can have confusing results or become too complicated for the average user to understand.

Edited by user Sunday, September 1, 2019 6:50:38 AM(UTC)  | Reason: Not specified

adyy  
#7 Posted : Sunday, September 1, 2019 8:06:40 AM(UTC)
adyy

Rank: Member

Reputation:

Groups: Approved
Joined: 8/25/2019(UTC)
Posts: 20
China

Was thanked: 1 time(s) in 1 post(s)
I understand the logic you're talking about, and ignoring hotkeys really complicates S+.net, which is probably just a function that very few people use. Please forget my bad idea.

The mouse gestures plug-in I use in Firefox is indeed Firegestures, and the code you gave me works well.
I really admire your efforts to improve S+.net.

Thanks again.

Edited by user Sunday, September 1, 2019 8:08:34 AM(UTC)  | Reason: Not specified

adyy  
#8 Posted : Tuesday, September 3, 2019 7:43:26 PM(UTC)
adyy

Rank: Member

Reputation:

Groups: Approved
Joined: 8/25/2019(UTC)
Posts: 20
China

Was thanked: 1 time(s) in 1 post(s)
After several days of use, it was found that the recognition rate of replay gestures was not very high, for more complex gestures.

Such as DU, UD, ULD, etc., are often recognized as D or U.

I wonder if gesture replay is too fast? Is there a way to slow down the speed of replaying gestures?
Rob  
#9 Posted : Tuesday, September 3, 2019 8:32:48 PM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 5 times
Was thanked: 96 time(s) in 83 post(s)
That's quite possible, in fact it's very likely.

Looking at the code, I used to have some sleep calls between events, but I commented them out. I will have to take a look at that.

So replaying the gesture is something you can handle in script as well.

To make it simple/centralized, enable Global Actions > Load/Unload Scripts > Load Script and paste this function in the script. This will make the function available to any script.
Code:
function replayGesture(gesturePoints, strokeButton) {
    sp.ConsumePhysicalInput(true);
    sp.MouseMove(gesturePoints.First()); 
    sp.Sleep(50);
    sp.MouseClick(gesturePoints.First(), strokeButton, true, false); 
    for(var i = 1; i < gesturePoints.Count(); i++) {
        sp.Sleep(3);
        sp.MouseMove(gesturePoints[i]);
    }
    sp.Sleep(10);
    sp.MouseClick(gesturePoints.Last(), strokeButton, false, true); 
    sp.ConsumePhysicalInput(false);
}

Then in your actions, replace the sp.RelayGesture(action.GesturePoints, action.StrokeButton); code with:
Code:
replayGesture(action.GesturePoints, action.StrokeButton);

Obviously, you can tweak the sp.Sleep() delay values as needed to be fast, but always be recognized.

Let me know if this works and let me know what sleep values you used so I can put those into the S+ function.

IMPORTANT: Be very careful with the function, since it calls sp.ConsumePhysicalInput(true) no physical keyboard or mouse input will be processed until sp.ConsumePhysicalInput(false) is called. So if you have a script error after the first call you won't be able to use the computer :) Although, not too long ago I added some code to reset on session switch, so Ctrl+Alt+Delete should reset this and allow physical input again. The reason for these calls is to prevent your mouse movements from interfering with the replay of the mouse events.

That function script is nearly identical to what's in the S+ code, so there's really no negative impact of using it instead of the built-in relay call.
Rob  
#10 Posted : Tuesday, September 3, 2019 8:48:46 PM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 5 times
Was thanked: 96 time(s) in 83 post(s)
You can also speed up the replay by skipping gesture points, since you really don't need to have fine details for simple line-based gestures like UD, DU, ULD.

Change the for loop to this, which would only move the mouse for every 3 points instead of every single gesture point.

Code:
for(var i = 1; i < gesturePoints.Count(); i += 3) {

You could also increase the 3 to a higher value as well, to skip more points between each movement during replay.
adyy  
#11 Posted : Tuesday, September 3, 2019 9:10:06 PM(UTC)
adyy

Rank: Member

Reputation:

Groups: Approved
Joined: 8/25/2019(UTC)
Posts: 20
China

Was thanked: 1 time(s) in 1 post(s)
It works very well on my computer,just only needs to set a delay of 1 millisecond.

function replayGesture(gesturePoints, strokeButton) {
sp.ConsumePhysicalInput(true);
sp.MouseMove(gesturePoints.First());
sp.Sleep(5);
sp.MouseClick(gesturePoints.First(), strokeButton, true, false);
for(var i = 1; i < gesturePoints.Count(); i += 3) {
sp.Sleep(1);
sp.MouseMove(gesturePoints[i]);
}
sp.Sleep(1);
sp.MouseClick(gesturePoints.Last(), strokeButton, false, true);
sp.ConsumePhysicalInput(false);
}
adyy  
#12 Posted : Tuesday, September 3, 2019 9:14:55 PM(UTC)
adyy

Rank: Member

Reputation:

Groups: Approved
Joined: 8/25/2019(UTC)
Posts: 20
China

Was thanked: 1 time(s) in 1 post(s)
The success rate of the test is close to 100%,hope this test will be useful to you.
Rob  
#13 Posted : Tuesday, September 3, 2019 9:15:58 PM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 5 times
Was thanked: 96 time(s) in 83 post(s)
Glad to hear! I'll update the S+ code to have the same delays.

Though it won't skip points because that may not be desired in all circumstances, so you can keep using this function.
Mateus  
#14 Posted : Wednesday, November 27, 2019 2:11:28 AM(UTC)
Mateus

Rank: Newbie

Reputation:

Groups: Approved
Joined: 8/21/2019(UTC)
Posts: 7

Thanks: 1 times
I usually have to disable stroke+ while gaming in fullscreen so it doesn't get in the way of some game mechanics, ex:
- Strong attack with right-click (where you have to hold it).
- Games like OSU! Where you have to click a lot and has custom sensitivity (triggering stroke+ makes the pointer jump because of the sensitivity difference)

Adyy's Idea would help me with that so I could disable it for when those apps are selected.

Other ideas are:
- Have a keyboard shortcut to toggle stroke+ instead of clicking on the icon. (seems like an easy solution, but the downside is that we would lose the hotkeys too).
- Being able to toggle gesture detection with a hotkey (we have the ignore keys, but you have to hold them, which isn't very nice for this use case)

Rob  
#15 Posted : Wednesday, November 27, 2019 8:56:32 AM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 5 times
Was thanked: 96 time(s) in 83 post(s)
You can already define an Ignored app which disables S+ when the window becomes active. Combined with Options > Advanced > Enable on No Ignore App Match, S+ will re-enable itself when you exit or tab out of the app.
I play WoW and have it as an ignored app that disables S+ when WoW is active, and re-enables S+ when I leave the game via the above option.

You can make a hot key to toggle S+ mouse and keyboard capture. Global hot keys, timers, window foreground scripts, etc all continue to function, this just prevents the mouse and keyboard hooks from performing any logic on the events.

Note: You need to define this hot key as global (make sure Unregistered is not checked) so it will work when capture is disabled. For global hot keys, Windows sends a message to S+ to say the hot key was pressed and the script will be executed. Unregistered hot keys requires keyboard capture to be enabled.
Code:
if(sp.GetStoredBool("CaptureDisabled")) {
    sp.EnableCapture();
    sp.DeleteStoredBool("CaptureDisabled");
} else {
    sp.DisableCapture();
    sp.StoreBool("CaptureDisabled", true);
}


There also exists these properties which allow you to disable processing logic for only the mouse or keyboard.

Code:
sp.MouseCaptureEnabled = false; // true to enable processing logic
sp.KeyboardCaptureEnabled = false; //true to enable processing logic


Note that for any of the above, they don't remove the mouse/keyboard hooks, just don't perform any logic - returning the control to Windows immediately. You'd have to test these out during game play to see if they still cause any interference/delays.

This will disable S+ completely:
sp.Disable();

But no hot keys or anything else will work, it's the same as clicking the icon - the only way to re-enable S+ is to click the icon once it's been disabled.

Though any timer scripts will continue to execute even while S+ is disabled, so you could have a timer script watching for something to occur (could use sp.GetKeyState to watch for a key combination) then call this to re-enable S+:
sp.Enable();

Edited by user Wednesday, November 27, 2019 5:50:07 PM(UTC)  | Reason: Not specified

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.