StrokesPlus.net Forum
»
General Discussion
»
General Discussion
»
How to disable only mouse painting and not keyboard in an application?
Rank: Newbie
Groups: Approved
Joined: 8/11/2021(UTC) Posts: 3
Thanks: 1 times
|
How to disable only mouse painting and not keyboard in an application?
我想在我的游戏中, 禁用右键绘画, 但是想保留文本扩展
I want to disable right-click painting in my game, but I want to keep the Text Expansion
谢谢 thank you
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,349 Location: Tampa, FL Thanks: 28 times Was thanked: 416 time(s) in 354 post(s)
|
Start by adding this to your Global Actions > Window Events > Foreground Window Change: Code:var wndTitle = sp.ForegroundWindow().Title;
StrokesPlus.Console.Log(`Title: ${wndTitle}`, "Foreground Window Change");
Right-click the S+ tray icon and select Console, then click the User tab. This will show you the log entries each time you make a different window active. Open your game, then check the console to see the title of the game's window. In my example, I'm using Notepad, so I see this in the Console: Code:2021-08-24 09:34:41.19: [Foreground Window Change] Title: StrokesPlus.net Settings
2021-08-24 09:34:45.15: [Foreground Window Change] Title: *Untitled - Notepad
I comment out the console log line, then take the *Untitled - Notepad window title and use this script: Code:var wndTitle = sp.ForegroundWindow().Title;
//StrokesPlus.Console.Log(`Title: ${wndTitle}`, "Foreground Window Change");
if(wndTitle === "*Untitled - Notepad")
{
// If Notepad, prevent S+ from intercepting mouse input
StrokesPlus.Input.Hooks.Mouse.Active = false;
}
else
{
// If not Notepad, enable the mouse input interception
StrokesPlus.Input.Hooks.Mouse.Active = true;
}
So anytime I switch to the Notepad window, mouse input is ignored by S+ and I cannot draw gestures, but Text Expansions will work. When I switch to a different application, mouse input is again processed by S+. I have only performed some simple tests, so you may need to refine things. Note that I did not use the EXE name since that is a very resource intensive procedure to get the EXE name, and for scripts like this which are constantly being triggered, I try to avoid that to ensure the script does not affect perforrmance.
|
1 user thanked Rob for this useful post.
|
|
|
Rank: Newbie
Groups: Approved
Joined: 8/11/2021(UTC) Posts: 3
Thanks: 1 times
|
|
|
|
|
StrokesPlus.net Forum
»
General Discussion
»
General Discussion
»
How to disable only mouse painting and not keyboard in an application?
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