HotKey UDF
#21
Posted 27 June 2009 - 03:06 AM
#22
Posted 27 June 2009 - 05:33 AM
#Include <HotKey.au3> Global Const $VK_RETURN = 0x0D Global $Edit, $hEdit $GUi = GUICreate('Test', 400, 400) $Edit = GUICtrlCreateEdit('', 10, 10, 380, 380) $hEdit = GUICtrlGetHandle($Edit) GUISetState() _HotKeyAssign($VK_RETURN, 'MyFunc', $GUi , $HK_FLAG_NOBLOCKHOTKEY) Do Until GUIGetMsg() = -3 Func MyFunc() If _WinAPI_GetFocus() <> $hEdit Then Return EndIf ConsoleWrite('OK' & @CR) EndFunc ;==>MyFunc
#23
Posted 28 June 2009 - 11:56 AM
Then it will auto disapper after 2s. Same for function, the functions will be terminated after 2s.
#24
Posted 28 June 2009 - 12:17 PM
MyFunc() in your case is a function of the interruption to the main program. Need to be crazy to stop the hook procedure. By the way I wrote about this in the UDF. See example 3 as should be done.Another question Yashied, When i'm using the above example i have big problem, if i put a msgbox in
Then it will auto disapper after 2s. Same for function, the functions will be terminated after 2s.
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 | IconChooser 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 | AITray UDF Library

#25
Posted 28 June 2009 - 03:57 PM
MyFunc() in your case is a function of the interruption to the main program. Need to be crazy to stop the hook procedure. By the way I wrote about this in the UDF. See example 3 as should be done.
I got the idea. Thanks
#26
Posted 29 June 2009 - 12:39 PM
Best Regards
OS: Windows 7 - 64bit - Ultimate, AutoIt Version: 3.3.8.1, AutoIt Editor: SciTE, Website: http://www.funk.eu, My unsolved Questions: Get default Window Size and Position,
#27
Posted 29 June 2009 - 01:10 PM
@nguyenbason
In version 1.6 your problem is solved.
@KaFu
I have everything works OK. Tell me, this example works for you (with version 1.6)?
Edited by Yashied, 29 June 2009 - 01:34 PM.
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 | IconChooser 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 | AITray UDF Library

#28
Posted 29 June 2009 - 01:40 PM
Best Regards
OS: Windows 7 - 64bit - Ultimate, AutoIt Version: 3.3.8.1, AutoIt Editor: SciTE, Website: http://www.funk.eu, My unsolved Questions: Get default Window Size and Position,
#29
Posted 29 June 2009 - 01:49 PM
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 | IconChooser 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 | AITray UDF Library

#30
Posted 29 June 2009 - 11:32 PM
I think you have an awesome set of features, and I'd hate to bother you for another one - but its definitely something possible to do, it just requires a bit of tinkering around... Anyway, what I was wondering is if you could add the ability to provide a 'hotkey release' message. This is something I added in my _AsyncHotKeySet code, and though its probably a bit less complicated then adding it to your code, it does give you an idea of how it could possibly be done.
I'd add another flag to your code, something like '$HK_FLAG_CALLONRELEASE', which would require either that:
A.) your code waits for the initial hotkey, just takes note that the hotkey was pressed, and then when it sees the complete hotkey has been released, it calls the given function, or
B.) that you call the same function for initial hotkey press, and then on hotkey release.
I think A.) would make more sense as you wouldn't want to have two flags causing a required parameter to a function (in B.)'s case, a 'pressed/released' parameter)
Even though you might not see it, there's big potential in the hotkey 'release' message. A program can execute a given set of commands *only* after the key is released, or it could execute a set of commands on initial hotkey press and only terminate them when the hotkey is released. This could be useful for a bunch of things, but if I'd have to give an example right off the bat: lets say a gamer wanted to have some activity repeated while a key is held down, and stopped when it's released - this would be the perfect method. Or if they needed something done at precisely the right time - they could hold down the hotkey in anticipation, and release it to have the actual code execute.
*edit: Just for clarification: I don't need it for cheats - typically I'll just use cheatcodes or trainers for that
Anyway, thanks again for your great work. It's really nice to have Hotkeys that work consistently across the board (unlike HotKeySet)
-Ascend4nt
Edited by ascendant, 30 June 2009 - 06:07 PM.
Full-Screen Crash Recovery | Performance Counters in Windows - Measure CPU,Disk,Network etc Performance | Process, Thread, & DLL Functions UDFs | Windows Desktop Dimmer Shade | CrossHairs (FullScreen) | _EnumChildWindows (controls etc) | Rubber-Band Boxes using GUI's (_GUIBox) | File + Process Imports/Exports Information | _DLLStructDisplay (Debug!) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters
Wrappers/Modifications of others' contributions:
_DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity)
UDF's added support/programming to:
_ExplorerWinGetSelectedItems | MIDI UDF (original code: eynstyne)
(All personal code/wrappers centrally located at Ascend4nt's AutoIT Code)
#31
Posted 30 June 2009 - 01:46 AM
Thanks Yashied,The library has been updated.
@nguyenbason
In version 1.6 your problem is solved.
@KaFu
I have everything works OK. Tell me, this example works for you (with version 1.6)?
Let me try it
Edit: Work very very good. Thanks
Edited by nguyenbason, 30 June 2009 - 02:24 AM.
#32
Posted 01 July 2009 - 03:03 PM
ascendant, I suggest you test the HotKey UDF v1.7 beta. I have defined the $HK_FLAG_POSTCALL flag. See details inside the UDF. Here is a simple example of using this flag.Yashied, this is an excellent program. I had thought HotKeySet() was using a keyboard hook at first, but after working with your code, I realized - apparently not! In fact, the whole purpose of the _AsyncHotKeySet UDF (rewrite, in my signature) was because certain applications/games were not recognizing the hotkeys I was pressing when set with HotKeySet(). But using your code, no problem - I no longer need _AsyncHotKeySet to poll the status of keys.
I think you have an awesome set of features, and I'd hate to bother you for another one - but its definitely something possible to do, it just requires a bit of tinkering around... Anyway, what I was wondering is if you could add the ability to provide a 'hotkey release' message. This is something I added in my _AsyncHotKeySet code, and though its probably a bit less complicated then adding it to your code, it does give you an idea of how it could possibly be done.
I'd add another flag to your code, something like '$HK_FLAG_CALLONRELEASE', which would require either that:
A.) your code waits for the initial hotkey, just takes note that the hotkey was pressed, and then when it sees the complete hotkey has been released, it calls the given function, or
B.) that you call the same function for initial hotkey press, and then on hotkey release.
I think A.) would make more sense as you wouldn't want to have two flags causing a required parameter to a function (in B.)'s case, a 'pressed/released' parameter)
Even though you might not see it, there's big potential in the hotkey 'release' message. A program can execute a given set of commands *only* after the key is released, or it could execute a set of commands on initial hotkey press and only terminate them when the hotkey is released. This could be useful for a bunch of things, but if I'd have to give an example right off the bat: lets say a gamer wanted to have some activity repeated while a key is held down, and stopped when it's released - this would be the perfect method. Or if they needed something done at precisely the right time - they could hold down the hotkey in anticipation, and release it to have the actual code execute.
*edit: Just for clarification: I don't need it for cheats - typically I'll just use cheatcodes or trainers for that. What I have used it for though is grabbing music (setting an app to start recording (& then stop), or even to grab screenshots)
Anyway, thanks again for your great work. It's really nice to have Hotkeys that work consistently across the board (unlike HotKeySet)
-Ascend4nt
#Include <HotKey_17_beta.au3> Global Const $VK_ESCAPE = 0x1B Global Const $VK_F12 = 0x7B _HotKeyAssign($VK_F12, 'MyFunc', BitOR($HK_FLAG_DEFAULT, $HK_FLAG_EXTENDEDCALL, $HK_FLAG_POSTCALL)) _HotKeyAssign(BitOR($CK_CONTROL, $VK_ESCAPE), 'Quit') While 1 Sleep(10) WEnd Func MyFunc($iKey) If $iKey > 0 Then ConsoleWrite('F12 (0x' & Hex($iKey, 4) & ') pressed!' & @CR) Else MsgBox(0, 'Hot key Test Message', 'F12 (0x' & Hex(Abs($iKey), 4) & ') has been released!') EndIf EndFunc ;==>MyFunc Func Quit() Exit EndFunc ;==>Quit
HotKey_17_beta.au3 24.35K
436 downloadsRemark.
There is a basic principle on which based work this library - the next hot key will NOT work until the previous will not be released.
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 | IconChooser 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 | AITray UDF Library

#33
Posted 01 July 2009 - 10:43 PM
ascendant, I suggest you test the HotKey UDF v1.7 beta. I have defined the $HK_FLAG_POSTCALL flag. See details inside the UDF. ...
Remark.
There is a basic principle on which based work this library - the next hot key will NOT work until the previous will not be released.
Yashied, thank you for your work, much appreciated. However, just a couple of questions:
1. If I were to use a modifier like Ctrl+Alt along with F12, it will send a 'Release' message even if I'm still holding down Ctrl+Alt. Is that the intended behavior, to ignore modifier keys?
2. If I hold down Ctrl+Alt+F12, then release Ctrl+Alt, and then press say 'Shift' and finally release F12 (even releasing Shift too), the function never gets the 'Released' message. Same goes for re-pressing Ctrl or Alt, and then releasing all three - the Released message is never sent.
Thanks again though!
Had I the patience to try and understand your code I might try and see what the problem is, but uncommented code for me is a nightmare
Full-Screen Crash Recovery | Performance Counters in Windows - Measure CPU,Disk,Network etc Performance | Process, Thread, & DLL Functions UDFs | Windows Desktop Dimmer Shade | CrossHairs (FullScreen) | _EnumChildWindows (controls etc) | Rubber-Band Boxes using GUI's (_GUIBox) | File + Process Imports/Exports Information | _DLLStructDisplay (Debug!) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters
Wrappers/Modifications of others' contributions:
_DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity)
UDF's added support/programming to:
_ExplorerWinGetSelectedItems | MIDI UDF (original code: eynstyne)
(All personal code/wrappers centrally located at Ascend4nt's AutoIT Code)
#34
Posted 02 July 2009 - 08:32 AM
Thanks to you, ascendant. But take into account all the nuances are not trivial task, especially in the hook. In this case, the code will be in x8 more and less reliable. It may be more reasonable to implement it in a particular case, rather than to write a universal procedure, thereby sacrificing its core strengths. I decided to take a timeout for this job and leave until version 1.6. But if the 1.7 beta to something interesting, you can use it, it is fully working.Yashied, thank you for your work, much appreciated. However, just a couple of questions:
1. If I were to use a modifier like Ctrl+Alt along with F12, it will send a 'Release' message even if I'm still holding down Ctrl+Alt. Is that the intended behavior, to ignore modifier keys?
2. If I hold down Ctrl+Alt+F12, then release Ctrl+Alt, and then press say 'Shift' and finally release F12 (even releasing Shift too), the function never gets the 'Released' message. Same goes for re-pressing Ctrl or Alt, and then releasing all three - the Released message is never sent.
Thanks again though!
Had I the patience to try and understand your code I might try and see what the problem is, but uncommented code for me is a nightmare
Once again thank you for your understanding of this material, I hope I will come back to this later.
Good luck.
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 | IconChooser 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 | AITray UDF Library

#35
Posted 07 July 2009 - 08:48 AM
Best Regards
OS: Windows 7 - 64bit - Ultimate, AutoIt Version: 3.3.8.1, AutoIt Editor: SciTE, Website: http://www.funk.eu, My unsolved Questions: Get default Window Size and Position,
#36
Posted 07 July 2009 - 08:57 AM
$HK_FLAG_NOBLOCKHOTKEY not fit?Yashied, working with your UDF and in connection to my last request... would it be possible to add a flag to the function call, with which the user can chose whether the key is consumed or not?
Best Regards
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 | IconChooser 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 | AITray UDF Library

#37
Posted 07 July 2009 - 09:01 AM
OS: Windows 7 - 64bit - Ultimate, AutoIt Version: 3.3.8.1, AutoIt Editor: SciTE, Website: http://www.funk.eu, My unsolved Questions: Get default Window Size and Position,
#38
Posted 17 August 2009 - 12:44 PM
But I have a question, why the mouse buttons are not supported?
Now I use AsyncHotKeySet() to set mouse hotkeys, but it can not use modifiers.
Is it possible to use mouse buttons as hotkey in your UDF?
#39
Posted 17 August 2009 - 02:03 PM
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 | IconChooser 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 | AITray UDF Library

#40
Posted 17 August 2009 - 03:26 PM
After pressing Win-L the computer locks and the screen saver runs. The problem is after I unlock the computer the keyboard locks up until I hit a modifier key (shift, ctrl, alt, or win).
Try this to recreate:
- Have Notepad open when running the script
- Run the script
- Press Win-L
- Unlock the computer
- Try typing in Notepad
- Typing "l" the first time will allow all the alphanumeric keys to work. Typing "l' the second time will lock the computer without pressing the Win key.
#include "HotKey.au3" #include "vkConstants.au3" HotKeySet("{Esc}", "_Quit") _HotKeyAssign(BitOr($CK_WIN, $VK_L), "ScreenSaver") While 1 Sleep(10) WEnd Func ScreenSaver() Local Const $SC_SCREENSAVE = 0xF140 DllCall('user32.dll', 'int', 'LockWorkStation') _SendMessage(_WinAPI_GetDesktopWindow(), $WM_SYSCOMMAND, $SC_SCREENSAVE, 0) EndFunc ;==>ScreenSaver Func _Quit() Exit EndFunc ;==>_Quit
The problem isn't specific to Win-L. The same thing happens when I change the script to use Win-K (hitting "k" the second time will lock the computer)
Any ideas on what I'm doing wrong?
--Jeff
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users





