MIRAG3 Posted August 16, 2011 Share Posted August 16, 2011 Hey all,Quick question, I am using several hotkeys in my script and currently have it setup to disable the hotkeys if the script does not have focus. However the specific hotkeys do not function in other programs or the OS when they are "disabled".It appears that AutoIt is still filtering the specific keys.Example:While 1 $CurWindowEx = WinGetTitle("active") If $CurWindowEx = "Search Tool" Then HotKeySet ("{F5}" ,"EndSearch") HotKeySet ("{Esc}", "UIClose") HotKeySet ("{F2}", "Welcome") HotKeySet ("!{F4}","altf4") HotKeySet ("!{F1}", "State_Debug") Elseif $CurWindowEx <> "Search Tool" Then HotKeySet ("{F5}","") HotKeySet ("{Esc}","") HotKeySet ("{F2}", "") HotKeySet ("!{F4}","") HotKeySet ("!{F1}","") Endif $Event_Man = GUIGetMsg() Select Case $Event_Man = $GUI_EVENT_CLOSE FindUIClose() EndSelect WendHow can I completely disable AutoIt's filtering of hotkeys when it is not in focus (active window)?Thanks. Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted August 16, 2011 Share Posted August 16, 2011 Do you think Au3Check is just joking with you when it errors out or what? C:\Users\Admiral\AutoIt TNG\Från forumet\401.au3(10,22) : ERROR: (): undefined function. HotKeySet ("{F5}","")(may need SciTE4AutoIt3, don't remember, but you should have it already for the tons of improvements it adds to your AutoIt experience, not using it is insane!)) As to the actual problem, you should not give it a empty string, you should skip the parameter, just like the helpfile says: function - [optional] The name of the function to call when the key is pressed. Not specifying this parameter will unset a previous hotkey. Easy peasy .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 Link to comment Share on other sites More sharing options...
MIRAG3 Posted August 16, 2011 Author Share Posted August 16, 2011 (edited) Do you think Au3Check is just joking with you when it errors out or what???? Not following you, that is just a small section of the entire script (almost 2000 lines).Currently using SciTE4AutoIt3. <- AWESOMEAs to the actual problem, you should not give it a empty string, you should skip the parameter, just like the helpfile says:Easy peasy Ahh, jeese... good catch. Will try that now.---Update:SUCCESS, thanks Admiral.Love it when the solution is just following proper syntax. HA. Edited August 16, 2011 by MIRAG3 Link to comment Share on other sites More sharing options...
Developers Jos Posted August 16, 2011 Developers Share Posted August 16, 2011 (may need SciTE4AutoIt3, don't remember, Yes, else it will just run AutoIt3.exe for Run and Aut2EXE.exe for Compile/build.Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted August 16, 2011 Share Posted August 16, 2011 ??? Not following you, that is just a small section of the entire script (almost 2000 lines).Currently using SciTE4AutoIt3. <- AWESOMEAre you saying you have more errors or? I mean, there should be zero, so the HotKeySet()'s being wrong when they error should be kinda obvious, shouldn't it? .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 Link to comment Share on other sites More sharing options...
guinness Posted August 16, 2011 Share Posted August 16, 2011 (edited) Why not look at GUISetAccelerators() instead, as HotKeySet() is Global and can sometimes conflict with other programs using the same HotKey's. GUISetAccelerators()' are bound to the GUI handle you pass to the function. Edited August 16, 2011 by guinness UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
MIRAG3 Posted August 16, 2011 Author Share Posted August 16, 2011 (edited) Awesome!Thanks Admiral and Jos!Thanks for the suggestion Guiness, will take a look at GUISetAccelerators().Turned out to be human error, following correct syntax helps!Are you saying you have more errors or? I mean, there should be zero, so the HotKeySet()'s being wrong when they error should be kinda obvious, shouldn't it? That's the weird part, AutoIt didn't return an error for the HotKeySet ("{Esc}","") sytnax.No worries, working now. Edited August 16, 2011 by MIRAG3 Link to comment Share on other sites More sharing options...
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