StrokesPlus.net Forum
»
General Discussion
»
Feature Requests
»
Add an event when the application is in the foreground.
Rank: Newbie
Groups: Approved
Joined: 7/31/2023(UTC) Posts: 2
|
Hello,
I want to send messages to a mqtt broker. I can send a message when a gesture is made but I would also like to send a message simply when the application is in front (selected, but without gesture).
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,382 Location: Tampa, FL Thanks: 28 times Was thanked: 431 time(s) in 364 post(s)
|
You can use Global Actions > Window Events > Foreground Window Change. This gets executed every time a window becomes active - e.g. switching back and forth between apps would execute this each time a different app becomes the active window. Code:try {
var currentWindow = sp.ForegroundWindow();
var exeName = currentWindow.ExecutableName.toLowerCase();
if (exeName == "mqtt_app.exe") {
//Do something here
}
} catch (err) {
StrokesPlus.Console.Log(`Error getting FG window info: FG window title: ${sp.ForegroundWindow().Title}`);
}
|
|
|
|
Rank: Newbie
Groups: Approved
Joined: 7/31/2023(UTC) Posts: 2
|
Big thanks!
I am a little confused because I had not seen this function. Strokesplus is really good soft!
Best regards
|
|
|
|
StrokesPlus.net Forum
»
General Discussion
»
Feature Requests
»
Add an event when the application is in the foreground.
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.
Important Information:
The StrokesPlus.net Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close