Change Keys only in photoshop? Topic is solved
Change Keys only in photoshop? Topic is solved
I just got a surface pen, and it has a right click button on the side. I want to change it so that instead of right clicking, the button is undo, (ctrl z). But I don't want all right clicks to be undo, only when I click the right button on the pen, not on a mouse. If that's not possible, is there anyway to make the right click button be ctrl z only in Photoshop and adobe animate, and then stop the script when I get out of those programs? I have no idea how to script, so if someone could just put a completed script, that would be great.
-
- Posts: 33
- Joined: 09 Apr 2016, 22:14
Re: Right click only in photoshop?
You will need to first get the Window Class of the two applications (look for the string after ahk_class) using the following tool:
https://github.com/fincs/SciTE4AutoHotk ... owInfo.ahk
https://github.com/fincs/SciTE4AutoHotk ... owInfo.ahk
Code: Select all
#IfWinActive, ahk_class MyWinClass1
RButton::SendInput, ^z
#IfWinActive
#IfWinActive, ahk_class MyWinClass2
RButton::SendInput, ^z
#IfWinActive
Re: Change Keys only in photoshop?
I get the script, but how would I find the class? Would I need to have the applications open?
-
- Posts: 33
- Joined: 09 Apr 2016, 22:14
Re: Change Keys only in photoshop?
1. Install AutoHotkeySoupLover wrote:I get the script, but how would I find the class? Would I need to have the applications open?
2. Download the following file (click on "Raw" then Save As from your browser)- https://github.com/fincs/SciTE4AutoHotk ... owInfo.ahk
3. Run the file ActiveWindowInfo.ahk - this will open a window called "Active Window Info"
4. Open your Photoshop application, resize the Photoshop window so that it is next to "Active Window Info" window. Now click anywhere inside the Photoshop window and you will see the ahk_class in the "Active Window Info" window.
Re: Change Keys only in photoshop?
Thanks, it worked! For some reason, I have to click the stroke to undo, but it works! Thank you!
-
- Posts: 33
- Joined: 09 Apr 2016, 22:14
Re: Change Keys only in photoshop?
There's actually a better way I just thought of. On "RButton" you can check for the window underneath the mouse's position and see if its Photoshop or Adobe Animate and if so, then send the ^z. Otherwise if its not one of those two applications, then send a RButton as normal.
This would allow you to still right click on the Windows Task Bar while Photoshop is the "active window" (but not the window under the mouse cursor current position). See:
https://autohotkey.com/docs/commands/MouseGetPos.htm - MouseGetPos - you would need to get the ahk_class from OutputVarWin
Try this:
This would allow you to still right click on the Windows Task Bar while Photoshop is the "active window" (but not the window under the mouse cursor current position). See:
https://autohotkey.com/docs/commands/MouseGetPos.htm - MouseGetPos - you would need to get the ahk_class from OutputVarWin
Try this:
Code: Select all
RButton::
MouseGetPos, MyX, MyY, MyWinID
WinGetClass, MyWinClass, ahk_id %MyWinID%
If( (MyWinClass == "PhotoshopXYZ123") || (MyWinClass == "AnimateXYZ123") ) {
SendInput, ^z
} Else {
SendInput, {RButton}
}
Return
Who is online
Users browsing this forum: Descolada and 223 guests