Yashied Posted December 25, 2013 Author Share Posted December 25, 2013 The library has been updated.v1.8Fixed the silent removal hook from the hook chain in Windows 7 and later (read this for more information). Technically, I used the Raw Input to detect when Windows will remove hook from the hook chain. If this happens, the hook will be registered again immediately. ArthurK 1 My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
ArthurK Posted January 15, 2014 Share Posted January 15, 2014 Great job! Thanks for updating! I use this UDF for over 2 years! Keep growing, thank you! Link to comment Share on other sites More sharing options...
iCode Posted February 6, 2014 Share Posted February 6, 2014 was trying to troubleshoot a problem and noticed that the order in which the UDF's are included can break things this works as expected, where the input strings become "None" when you first run the code... #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include "F:\AutoIt\Resources\Funcs\_other\HotKey_Yashid\HotKey_2.1b.au3" #Include "F:\AutoIt\Resources\Funcs\_other\HotKey_Yashid\HotKey_vkConstants.au3" #Include "F:\AutoIt\Resources\Funcs\_other\HotKey_Yashid\HotKeyInput_1.3.au3" $Form1 = GUICreate("Form1", 619, 445, 628, 210) $HKI1 = _GUICtrlHKI_Create(0, 56, 55, 230, 20) $HKI2 = _GUICtrlHKI_Create(0, 56, 89, 230, 20) GUISetState(@SW_SHOW) Do Sleep(10) Until GUIGetMsg() = $GUI_EVENT_CLOSE however this causes the inputs to be empty when you move "HotKey_2.1b.au3" to the bottom... #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include "F:\AutoIt\Resources\Funcs\_other\HotKey_Yashid\HotKey_vkConstants.au3" #Include "F:\AutoIt\Resources\Funcs\_other\HotKey_Yashid\HotKeyInput_1.3.au3" #Include "F:\AutoIt\Resources\Funcs\_other\HotKey_Yashid\HotKey_2.1b.au3" $Form1 = GUICreate("Form1", 619, 445, 628, 210) $HKI1 = _GUICtrlHKI_Create(0, 56, 55, 230, 20) $HKI2 = _GUICtrlHKI_Create(0, 56, 89, 230, 20) GUISetState(@SW_SHOW) Do Sleep(10) Until GUIGetMsg() = $GUI_EVENT_CLOSEi was never aware that the order in which includes are added could cause a problem FUNCTIONS: WinDock (dock window to screen edge) | EditCtrl_ToggleLineWrap (line/word wrap for AU3 edit control) | SendEX (yet another alternative to Send( ) ) | Spell Checker (Hunspell wrapper) | SentenceCase (capitalize first letter of sentences) CODE SNIPPITS: Dynamic tab width (set tab control width according to window width) Link to comment Share on other sites More sharing options...
Yashied Posted February 6, 2014 Author Share Posted February 6, 2014 (edited) Yes, there is a problem. If you are using HotKey UDF in active GUI, please use the previous version (1.7).HotKey_1.7.zip Edited February 6, 2014 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
Yashied Posted February 6, 2014 Author Share Posted February 6, 2014 I fixed this issue. Please download UDF again from the first post. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
iCode Posted February 6, 2014 Share Posted February 6, 2014 thanks Yashied this UDF is a wonderful piece of work FUNCTIONS: WinDock (dock window to screen edge) | EditCtrl_ToggleLineWrap (line/word wrap for AU3 edit control) | SendEX (yet another alternative to Send( ) ) | Spell Checker (Hunspell wrapper) | SentenceCase (capitalize first letter of sentences) CODE SNIPPITS: Dynamic tab width (set tab control width according to window width) Link to comment Share on other sites More sharing options...
iCode Posted February 6, 2014 Share Posted February 6, 2014 Yashied - i made some notes here if you want to make HotKey and HotKeyInput UDFs more compatible with au3check with '-d -w 3 -w 4 -w 5' ... Func _HotKey_Assign unused var: $Error = False Func HK_WM_ACTIVATE add: #forceref $hWnd, $iMsg, $lParam Func HK_WM_HOTKEY add: #forceref $iMsg, $wParam Func HK_WM_INPUT add: #forceref $iMsg, $wParam Func _GUICtrlHKI_GetHotKey unused var: Local $Ret = 0 Func __HKI_Event add: #forceref $hEventHook, $iEvent, $hWnd, $iObjectID, $iChildID, $iThreadID, $iEventTime Func __HKI_WinVer add "Local": $tOSVI = DllStructCreate > Local $tOSVI = DllStructCreate add "Local": $Ret = DllCall > Local $Ret = DllCall FUNCTIONS: WinDock (dock window to screen edge) | EditCtrl_ToggleLineWrap (line/word wrap for AU3 edit control) | SendEX (yet another alternative to Send( ) ) | Spell Checker (Hunspell wrapper) | SentenceCase (capitalize first letter of sentences) CODE SNIPPITS: Dynamic tab width (set tab control width according to window width) Link to comment Share on other sites More sharing options...
Yashied Posted February 6, 2014 Author Share Posted February 6, 2014 (edited) @iCodeOk, done. Please download again.>HotKey UDF>HotKeyInput UDF Edited February 6, 2014 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
iCode Posted February 6, 2014 Share Posted February 6, 2014 no need to re-download if my suggestions were the only changes made i would humbly suggest considering bumping the version number though, so others know the UDF was updated thank you! FUNCTIONS: WinDock (dock window to screen edge) | EditCtrl_ToggleLineWrap (line/word wrap for AU3 edit control) | SendEX (yet another alternative to Send( ) ) | Spell Checker (Hunspell wrapper) | SentenceCase (capitalize first letter of sentences) CODE SNIPPITS: Dynamic tab width (set tab control width according to window width) Link to comment Share on other sites More sharing options...
iCode Posted February 7, 2014 Share Posted February 7, 2014 i keep bumping against a limitation where you cannot call _HotKey_Release() from within a function that was called with _HotKey_Assign() and i'm wondering if there is some work-a-round? the logic is like this: 1) register hotkey for func1 2) enter func1 using the hotkey 3) unregister and unhook the hotkey 4) either just before, or just after returning from func1, re-register the hotkey i've tried a few "tricks" to get this to work, but so far have not found a solution unfortunately i am not proficient enough to dig into this UDF to see if this limitation can be overcome, but it would be great if it could in my case i have a gui with the hotkey input controls that needs to be able to be shown with a hotkey, but i need to disable all hotkeys while i'm in the function containing this gui and then re-register all the hotkeys again on the flip side FUNCTIONS: WinDock (dock window to screen edge) | EditCtrl_ToggleLineWrap (line/word wrap for AU3 edit control) | SendEX (yet another alternative to Send( ) ) | Spell Checker (Hunspell wrapper) | SentenceCase (capitalize first letter of sentences) CODE SNIPPITS: Dynamic tab width (set tab control width according to window width) Link to comment Share on other sites More sharing options...
Yashied Posted February 7, 2014 Author Share Posted February 7, 2014 i keep bumping against a limitation where you cannot call _HotKey_Release() from within a function that was called with _HotKey_Assign() and i'm wondering if there is some work-a-round?Use $HK_FLAG_NOERROR flag. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
iCode Posted February 7, 2014 Share Posted February 7, 2014 i can do that, but that causes other problem -- 1), there is no way to stop the key from repeating -- BitOR($HK_FLAG_NOREPEAT, $HK_FLAG_NOERROR) doesn't work -- 2), the hotkey to show the gui may or may not work - i noticed this particularly when registering Shift+ one of the arrow keys (Left, Right, etc.) where when you hold the hotkey down, the function is never called -- 3) sometimes using the gui input control to change the hotkey to open the gui does not work on the 1st try (you have to press the key combo twice to get it to display correctly in the input control) also the gui can be shown without a hotkey, so there are 2 ways of showing it -- passing different flags to the UDF functions could be done based on how the GUI is displayed, but i think it would be better if such cases could be handled cleanly, without having to use $HK_FLAG_NOERROR i don't think this is an unusual scenario where you have, for example, a configuration GUI that can be shown with a hotkey and other ways (such as by clicking a button or menu item) and so i think it would be ideal if this limitation could be overcome in the code by dropping the $HK_FLAG_NOERROR flag and, perhaps, adding some code to _HotKey_Release() so that it does not function until hotkeys are released and there is nothing more to do i know that "adding some code" sounds rather dumb and i would like to offer a better fix or some example code, but allot of you guys that write these UDFs are simply working at a level which far exceeds mine, and so it is very difficult for me to follow the code, but if my suggestion is realistic, i think that would be the best and cleanest way to handle these scenarios where hotkeys need to be unregistered from a gui function called by a hotkey FUNCTIONS: WinDock (dock window to screen edge) | EditCtrl_ToggleLineWrap (line/word wrap for AU3 edit control) | SendEX (yet another alternative to Send( ) ) | Spell Checker (Hunspell wrapper) | SentenceCase (capitalize first letter of sentences) CODE SNIPPITS: Dynamic tab width (set tab control width according to window width) Link to comment Share on other sites More sharing options...
iCode Posted February 8, 2014 Share Posted February 8, 2014 i don't know what i'm missing here, but none of the _HotKey_Assign() examples below work when registering key combinations, except for the last one which is only a single key #include <HotKey_vkConstants.au3> #include <HotKey_2.1b.au3> ConsoleWrite(_HotKey_Assign(BitOR(0x11, 0x56), "test") & @LF) ; Ctrl+V ;ConsoleWrite(_HotKey_Assign(BitOR("0x11", "0x56"), "_testMe") & @LF) ; Ctrl+V ;ConsoleWrite(_HotKey_Assign(BitOR($VK_CONTROL, $VK_V), "test") & @LF) ; Ctrl+V ;ConsoleWrite(_HotKey_Assign(BitAND($VK_CONTROL, $VK_V), "test") & @LF) ; Ctrl+V ;ConsoleWrite(_HotKey_Assign($VK_CONTROL + $VK_V, "test") & @LF) ; Ctrl+V ;ConsoleWrite(_HotKey_Assign($VK_F1, "test") & @LF) ; Ctrl+V While 1 Sleep(10) WEnd Func test() ConsoleWrite("ok" & @LF) EndFunc funny thing is, i've already implemented this UDF in a script (using multiple keys and BitOR like you're supposed to) and _HotKey_Assign() works fine there win 7 x64 tried autoit x86 and x64, compiled and not compiled FUNCTIONS: WinDock (dock window to screen edge) | EditCtrl_ToggleLineWrap (line/word wrap for AU3 edit control) | SendEX (yet another alternative to Send( ) ) | Spell Checker (Hunspell wrapper) | SentenceCase (capitalize first letter of sentences) CODE SNIPPITS: Dynamic tab width (set tab control width according to window width) Link to comment Share on other sites More sharing options...
Yashied Posted February 8, 2014 Author Share Posted February 8, 2014 You can combine only one $VK_* and one up to four $CK_* constants that declared in the library. $VK_*SHIFT, $VK_*CONTROL, $VK_*MENU, and $VK_*WIN are not a bit constants and ignored by the function. Please read carefully description for the _HotKey_Assign() function. BitOR($CK_CONTROL, $VK_V) Global Const $CK_SHIFT = 0x0100 Global Const $CK_CONTROL = 0x0200 Global Const $CK_ALT = 0x0400 Global Const $CK_WIN = 0x0800 My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
iCode Posted February 8, 2014 Share Posted February 8, 2014 i knew i was going to be sorry i asked that question it works in my other script because i'm using hex valuse to combine the keys also, just wondering if you considered my >previous post? thanks again Yashied! FUNCTIONS: WinDock (dock window to screen edge) | EditCtrl_ToggleLineWrap (line/word wrap for AU3 edit control) | SendEX (yet another alternative to Send( ) ) | Spell Checker (Hunspell wrapper) | SentenceCase (capitalize first letter of sentences) CODE SNIPPITS: Dynamic tab width (set tab control width according to window width) Link to comment Share on other sites More sharing options...
Silpark Posted February 23, 2014 Share Posted February 23, 2014 First thanks for this great UDF but I think I've found a bug. If an hotkey with Ctrl in it, call a function sending another Ctr, then Ctrl stay pushed. Demonstration : #include <HotKey_18.au3> _HotKey_Assign(BitOR($CK_CONTROL, 0x0072), "test", $HK_FLAG_NOOVERLAPCALL) ; Hotkey is Ctrl + F3 Func test() Send("^c") ConsoleWrite("Test ") EndFunc While True Sleep(500) WEnd So if you run the script, press Ctr + F3 then now your mouse wheel zoom in / out instead of scrooling. Push the left Ctrl to unblock the situation. The only workaounf I've found is a bit baroque: Func test() Sleep(500) Send("^c") Sleep(300) Send("{LCTRL}") Sleep(300) ConsoleWrite("Test ") EndFunc Tested with HotKey 1.8 & 2.1b + Autoit 3.3.10.2 (Win XP 32) Link to comment Share on other sites More sharing options...
Danp2 Posted February 24, 2014 Share Posted February 24, 2014 Have you read this FAQ entry? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Silpark Posted February 26, 2014 Share Posted February 26, 2014 OK, so this is an Autoit probleme not related to Hotkey udf. Thanks for the link. Link to comment Share on other sites More sharing options...
Armag3ddon Posted May 15, 2014 Share Posted May 15, 2014 Hi there! I'm having a problem here that the assigned hotkeys are not recognised until I unfocus and refocus the GUI window that should process them. I'm running Win 7 x64. Minimal example: #include <GUIConstantsEx.au3> #include <HotKey.au3> #include <vkConstants.au3> Global $hWnd $hWnd = GUICreate("HotKeys", 800, 600, -1, -1, BitOR($WS_CAPTION, $WS_MINIMIZEBOX, $WS_MAXIMIZEBOX, $WS_SYSMENU, $DS_CONTEXTHELP, $WS_SYSMENU, $WS_VISIBLE, $WS_CLIPCHILDREN, $WS_THICKFRAME)) GUISetState(@SW_ENABLE, $hWnd) _HotKey_Assign($VK_RETURN, "PressedEnter", $HK_FLAG_NOBLOCKHOTKEY, $hWnd) While GUIGetMsg() <> $GUI_EVENT_CLOSE Sleep(10) WEnd GUIDelete($hWnd) Exit Func PressedEnter() ConsoleWrite("Pressed enter") EndFunc I don't get the "Pressed enter" message (i.e. hotkey is not recognised) until I click on another window and then back to this one. Am I using your UDF wrong? Link to comment Share on other sites More sharing options...
iCode Posted May 15, 2014 Share Posted May 15, 2014 just spotted this... If $HK_RID Then GUIRegisterMsg($HK_WM_INPUT, 'HK_WM_INPUT') If Not __HK_Raw() Then EndIf EndIf FUNCTIONS: WinDock (dock window to screen edge) | EditCtrl_ToggleLineWrap (line/word wrap for AU3 edit control) | SendEX (yet another alternative to Send( ) ) | Spell Checker (Hunspell wrapper) | SentenceCase (capitalize first letter of sentences) CODE SNIPPITS: Dynamic tab width (set tab control width according to window width) 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