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

Notification

Icon
Error

Options
Go to last post Go to first unread
Rob Otter  
#1 Posted : Thursday, October 29, 2020 11:40:37 AM(UTC)
Rob Otter

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 10/26/2020(UTC)
Posts: 32
Germany
Location: Darmstadt

Thanks: 11 times
Was thanked: 1 time(s) in 1 post(s)
Maybe I am missing something?

I know I can define gestures (action lists) and text expansions per application and can use Module name (exe) with Regex to match the gesture set on multiple apps.

But if multiple gesture sets match the same app (because it is specified in their Module name (exe)), all gesture sets after the first one matching do not work for the application.
It seems like S+ terminates searching for app definition after the first match. Without this stopping, it would be very easy to just define a gesture set like "Tabbing", "Texting", "Tabbing 2" (different hotkeys, same stroke) and then assign an app to a mixture of these.

I could write a thousand words more to explain in more detail why this would be very useful (at least for the way I imagine the usage) but maybe it´s not necessary - ask again if my question is still unclear.

Regards,
Rob Otter
Rob  
#2 Posted : Thursday, October 29, 2020 12:10:10 PM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 16 times
Was thanked: 174 time(s) in 151 post(s)
Yes, it stops searching for other apps once an app is matched. I'm not sure I'm following your issue or request about this.

Are you saying you'd have multiple applications (as defined in S+) which could match on the same criteria?
But that each of those applications have different gesture sets defined, so you'd want it to match a combination of gesture/application?

If so, I can say that's not something which will be easily changed. Plus, I don't believe two application definitions should be able to be matched for the same criteria (module, etc.) as that seems counter-intuitive/confusing.

Would you provide some additional example scenarios so I can better understand the overall objective?
Rob Otter  
#3 Posted : Friday, October 30, 2020 1:06:41 AM(UTC)
Rob Otter

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 10/26/2020(UTC)
Posts: 32
Germany
Location: Darmstadt

Thanks: 11 times
Was thanked: 1 time(s) in 1 post(s)
Yes, I need to make that more clear... Example:

- Several applications use tabs (Browsers, text editors, Excel ("Sheets"), even my Windows Explorer is enhanced using QtTabBar)
In each application I´d like to use the same gestures to switch between tabs, closing / unclosing / re-ordering them, etc. Up to this point, I could use global gestures and specify the appropriate hotkey for each command. But some apps need different hotkeys, e.g. closing a tab in Notepad++ uses Ctrl-W (as many other editors do) while most browsers use Ctrl-F4. Switching between tabs is often done with Alt-Left/Right, but to switch Sheets in Excel, it requires Ctrl-PgUp/PgDown.
There are many more examples. So I have to configure full sets of gestures for nearly each app individually, although 90% of their gestures are the same.

- This is just one aspect. Gestures for basic text functions is another one (e.g. I use "right-to-left" for Backspace, "left-to-right" for Space, "upperLeft-to-lowerRight" for Enter). This can be used in every text editor but not in Browsers (except when focus is on a text area). So, I can hardly define a full set of gestures matching two or more applications because they all will differ to a small amount.

- Up to now, I have not even talked about Text Expansion, which has the same "problem", but to a higher extent. Some text editors I use for programming where text abbreviations like "br" would expand to "<br/>" or "span" to "<span></span>{8x LEFT}", but in others (like MS Word) that I use solely for real text, "span" shall not be expanded and "br" may expanded to something else (the german "Berechtigung" in this case).

Of course, I can define one set covering the least common actions (which will be very, very small), make a copy of it for every new application and then add the missing actions specific for that app. But even if I would have to add only 2-3 actions, it is quite uncomfortable and, what is more uncomfortable, when I want to add a new gesture / text expansion, I need to manually add it to _all_ fitting applications.

All in all, if all application sets would be checked (and the last matching gesture / text expansion would be used), such sets could be seen more as functionality-specific and less as application-specific.

Or am I missing a very basic method of accomplishing this and spn is covering all this already in another way?
Rob  
#4 Posted : Friday, October 30, 2020 7:48:26 AM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 16 times
Was thanked: 174 time(s) in 151 post(s)
Okay, I see what you're getting at.

However, the core of S+ is very centered around a single matching application (or ignored app, they both inherit from the same class) or defaulting to Global if no app match. There was never any intent of supporting multiple matching applications as it complicates things and wasn't something I thought would make sense logically.

So the way the core of the application is written, that's simply not going to happen, at least not anytime soon! It would essentially require a massive rewrite of the application and I don't think the value is there for such an undertaking when an alternative exists.

You basically just need to define these at the Global level, since they're really not specific to an application as S+ sees things.

For text expansions, that would mean using the Automation method and crafting the necessary logic to handle the different applications. For example:
Code:
var fgWindowEXE = sp.ForegroundWindow().Process.MainModule.ModuleName;

switch(fgWindowEXE)
{
    case "chrome.exe":
        sp.SendKeys("Chrome");
        break;
    case "notepad++.exe":
        sp.SendKeys("Notepad Plus Plus");
        break;
    default:
        sp.SendKeys("default");
} 

It's really no different for handling tabs for different applications in the Global actions. Just check action.Window.Process.MainModule.ModuleName instead.
thanks 1 user thanked Rob for this useful post.
Rob Otter on 11/2/2020(UTC)
Rob Otter  
#5 Posted : Monday, November 2, 2020 1:29:25 AM(UTC)
Rob Otter

Rank: Advanced Member

Reputation:

Groups: Approved
Joined: 10/26/2020(UTC)
Posts: 32
Germany
Location: Darmstadt

Thanks: 11 times
Was thanked: 1 time(s) in 1 post(s)
Thanks, I feared I have to work around like that. But anyway I started to do so in a quite modular way using your example as a starting point. Once I have a code base that I am satisfied with, I´ll share that to all users, hoping it might be of help.
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.