jmiley 0 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! Share this post Link to post Share on other sites
monoscout999 10 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.... Share this post Link to post Share on other sites
AdmiralAlkex 125 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 Share this post Link to post Share on other sites