Rank: Newbie
Groups: Approved
Joined: 6/10/2021(UTC) Posts: 5
Thanks: 4 times
|
Make hotkeys work only in specific programs. I set a hotkey that I will use when I use a certain program, but when I exit that program, I have to go to the settings to turn off that hotkey, otherwise it will affect other programs.
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,234  Location: Tampa, FL Thanks: 27 times Was thanked: 381 time(s) in 330 post(s)
|
You can do something like this. In this example, the hotkey is defined as just the h key. If the active window is Photoshop, it sends Control+H otherwise it sends h for any other app. Code:if(sp.ForegroundWindow().ExecutableName == "Photoshop.exe") {
sp.SendModifiedVKeys([vk.LCONTROL], [vk.VK_H]);
} else {
sp.SendVKey(vk.VK_H);
}
|
 1 user thanked Rob for this useful post.
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,234  Location: Tampa, FL Thanks: 27 times Was thanked: 381 time(s) in 330 post(s)
|
I will add the feature request, but it's a lot of changes internally as I didn't originally set up hotkeys to be application-specific.
|
 1 user thanked Rob for this useful post.
|
|
|
Rank: Newbie
Groups: Approved
Joined: 6/10/2021(UTC) Posts: 5
Thanks: 4 times
|
Originally Posted by: Rob  You can do something like this. In this example, the hotkey is defined as just the h key. If the active window is Photoshop, it sends Control+H otherwise it sends h for any other app. Code:if(sp.ForegroundWindow().ExecutableName == "Photoshop.exe") {
sp.SendModifiedVKeys([vk.LCONTROL], [vk.VK_H]);
} else {
sp.SendVKey(vk.VK_H);
}
Thank you so much!
|
|
|
|
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