How can I perform an action before the original intended hotkey function?
Specifically, what I'd like to do is send some placeholder text to a text field before launching a Find & Replace operation.
Ctrl+H is used to launch the Find & Replace dialog, so when I press Ctrl+H, before the dialog opens, I'd like "MARKERHERE" to be sent to the text field where my cursor is.
I tried to pass through the hotkey, but the placeholder text is sent to the Find & Replace dialog instead of to the original text field. I also tried adding a sleep but that didn't help either.
Thank you in advance for your help!
Perform action before original hotkey function
-
- Posts: 264
- Joined: 09 Mar 2019, 01:52
- Location: Germany
- Contact:
Re: Perform action before original hotkey function
Could you split it up. When pressing CTRL+h do the first action. When release CTRL+h do the second action?
Re: Perform action before original hotkey function
That sounds like a good idea, but I don't know how to implement it. I tried this, but got an invalid hotkey error message:
^h Down::
Send MARKERHERE{SPACEBAR}
Return
^h Up::
Send ^h
Return
^h Down::
Send MARKERHERE{SPACEBAR}
Return
^h Up::
Send ^h
Return
Re: Perform action before original hotkey function
Code: Select all
$^h::
sendinput MARKERHERE{Space}
KeyWait, h
send ^h
return
Re: Perform action before original hotkey function
Remove the "Down." By default, hotkeys fire on the down press, rather than on release, so the "Down" is unneeded.
Re: Perform action before original hotkey function
Thank you! Both proposed solutions worked.
Who is online
Users browsing this forum: Bing [Bot], mstrauss2021, Spawnova, zephyrus2706 and 362 guests