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: 16
China

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: 340
United States

Thanks: 5 times
Was thanked: 64 time(s) in 56 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: 16
China

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: 340
United States

Thanks: 5 times
Was thanked: 64 time(s) in 56 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: 16
China

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: 340
United States

Thanks: 5 times
Was thanked: 64 time(s) in 56 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: 16
China

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: 16
China

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: 340
United States

Thanks: 5 times
Was thanked: 64 time(s) in 56 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: 340
United States

Thanks: 5 times
Was thanked: 64 time(s) in 56 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: 16
China

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: 16
China

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: 340
United States

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