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

Notification

Icon
Error

Options
Go to last post Go to first unread
Thaworn  
#1 Posted : Thursday, October 15, 2020 4:13:34 AM(UTC)
Thaworn

Rank: Newbie

Reputation:

Groups: Approved
Joined: 8/8/2020(UTC)
Posts: 8
Thailand

How to set hotkey only for specific application like mouse gesture?
Rob  
#2 Posted : Thursday, October 15, 2020 6:17:46 AM(UTC)
Rob

Rank: Administration

Reputation:

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

Thanks: 14 times
Was thanked: 163 time(s) in 141 post(s)
Hotkeys are normally registered globally with Windows (if the Unregistered box is not checked), so these cannot be application-specific.

Regardless of whether or not the hotkey is registered (the Unregistered option is to allow hotkeys that Windows won't allow), you can put the logic into the hotkey.

For example:
Code:
var fgWindow = sp.ForegroundWindow();
var exeName = fgWindow.Process.MainModule.ModuleName;

//exeName comparisons below are case-sensitive!
if(exeName === "chrome.exe") 
{
    sp.MessageBox("Chrome", "Chrome");
} 
else if(exeName === "notepad++.exe")
{
    sp.MessageBox("Notepad++", "Notepad++");
}
else if(exeName === "Discord.exe")
{
    sp.MessageBox("Discord", "Discord");
}
else
{
    sp.MessageBox("Other: " + exeName, "Other");
}


Thaworn  
#3 Posted : Thursday, October 15, 2020 4:05:44 PM(UTC)
Thaworn

Rank: Newbie

Reputation:

Groups: Approved
Joined: 8/8/2020(UTC)
Posts: 8
Thailand

Thank you so much.
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.