jmiley Posted May 23, 2011 Posted May 23, 2011 Hello everyone, I hope this question doesn't sound too amateurish, but I've been having troubles setting a hotkey for a specific window. Currently my script looks like: HotKeySet("{Enter}", "remap_enter") Func remap_enter() If WinActive("Window Title") Then _IELoadWait($oIE) $oForm = _IEFormGetObjByName ($oIE, "form") _IEFormSubmit ($oForm) ReplaceText() Else send ("{enter}") endIf EndFunc The hotkey works perfectly on the specific window. However, the enter key won't work anywhere else except if the specific window is open. Any suggestions out there? Thank you!
monoscout999 Posted May 23, 2011 Posted May 23, 2011 [autoit]HotKeySet("{Enter}", "remap_enter") The hotkey works perfectly on the specific window. However, the enter key won't work anywhere else except if the specific window is open. Any suggestions out there? Thank you! because this If WinActive("Window Title") Then you are telling the script to work only when the active window is "Window Title" when the active window is another window or the desktop the script send enter key then the func runs again and again and again....
AdmiralAlkex Posted May 23, 2011 Posted May 23, 2011 Open the helpfile and browse to HotKeySet(), it tells you how to disable the hotkey (enable it later) so you don't sit there in a eternal loop. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now