rexx Posted September 12, 2009 Share Posted September 12, 2009 Cool! Thanks i'll try it. I would have done the following: #Include <HotKey_17_beta.au3> Global Const $VK_F12 = 0x7B Global $Timer = 0 _HotKeyAssign($VK_F12, 'Message', BitOR($HK_FLAG_DEFAULT, $HK_FLAG_EXTENDEDCALL, $HK_FLAG_POSTCALL)) While 1 Sleep(10) WEnd Func Message($iKey) If $iKey > 0 Then If ($Timer) And (TimerDiff($Timer) < 250) Then MsgBox(0, 'Hotkey Test Message', 'Hotkey has been pressed!') $Timer = 0 Return EndIf $Timer = TimerInit() EndIf EndFunc ;==>Message HotKey_17_beta.au3 you can download here. Link to comment Share on other sites More sharing options...
sunafter Posted September 12, 2009 Share Posted September 12, 2009 very good! Link to comment Share on other sites More sharing options...
KinGzZz Posted September 13, 2009 Share Posted September 13, 2009 (edited) hi, i am new to autoit, can somebody tell me the code for auto space bar and auto click number 0, like 0.1 second delay for each click. thanks Edited September 13, 2009 by KinGzZz Link to comment Share on other sites More sharing options...
somdcomputerguy Posted September 13, 2009 Share Posted September 13, 2009 hi, i am new to autoit, can somebody tell me the code for auto space bar and auto click number 0, like 0.1 second delay for each click. thanksSee this post, auto spacebar - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
XEyE Posted November 1, 2009 Share Posted November 1, 2009 Thank you. But the hotkeys do not work when they meet a loop in a funtion. Just simply try this: #Include <HotKey.au3> Global Const $VK_ESCAPE = 0x1B Global Const $VK_F12 = 0x7B ; Assign "F12" with Message() and set extended function call _HotKeyAssign($VK_F12, 'Message', BitOR($HK_FLAG_DEFAULT, $HK_FLAG_EXTENDEDCALL)) ; Assign "CTRL-ESC" with Quit() _HotKeyAssign(BitOR($CK_CONTROL, $VK_ESCAPE), 'Quit') While 1 Sleep(10) WEnd Func Message($iKey) MsgBox(0, 'Hot key Test Message', 'F12 (0x' & Hex($iKey, 4) & ') has been pressed!') while 1 Sleep(100) WEnd EndFunc ;==>Message Func Quit() Exit EndFunc ;==>Quit Link to comment Share on other sites More sharing options...
Yashied Posted November 1, 2009 Author Share Posted November 1, 2009 (edited) Are you sure that this should work? Have you read the description about $HK_FLAG_NOOVERLAPCALL flag? Be sure to read. Anyway, you did a loop where it can not be done. This function is an interrupt for the main program, you must create another code design. Edited November 1, 2009 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...
XEyE Posted November 1, 2009 Share Posted November 1, 2009 Are you sure that this should work? Have you read the description about $HK_FLAG_NOOVERLAPCALL flag? Be sure to read. Anyway, you did a loop where it can not be done. This function is an interrupt for the main program, you must create another code design. Sorry about that. Im just thinking if that can work, that will be great! ^^ And i got my new code design. Thanks. expandcollapse popup#Include <HotKey.au3> Global Const $VK_ESCAPE = 0x1B Global Const $VK_F12 = 0x7B Global Const $VK_F11 = 0x7A _HotKeyAssign($VK_F12, 'Start') _HotKeyAssign($VK_F11, 'Pause') ; Assign "CTRL-ESC" with Quit() _HotKeyAssign(BitOR($CK_CONTROL, $VK_ESCAPE), 'Quit') Global $flag = False Global $counter = 1 While 1 if $flag then MainFunc() Else Sleep(10) EndIf WEnd Func Pause() $flag = False EndFunc Func Start() ;init() $flag = true EndFunc Func MainFunc() Sleep(100) $counter=$counter+1 ToolTip($counter) EndFunc ;==>Message Func Quit() exit EndFunc ;==>Quit Link to comment Share on other sites More sharing options...
Yashied Posted November 1, 2009 Author Share Posted November 1, 2009 expandcollapse popup#Include <HotKey.au3> Global Const $VK_ESCAPE = 0x1B Global Const $VK_F12 = 0x7B Global Const $VK_F11 = 0x7A _HotKeyAssign($VK_F12, 'Start') _HotKeyAssign($VK_F11, 'Pause') ; Assign "CTRL-ESC" with Quit() _HotKeyAssign(BitOR($CK_CONTROL, $VK_ESCAPE), 'Quit') Global $flag = False Global $counter = 1 While 1 if $flag then MainFunc() Else Sleep(10) EndIf WEnd Func Pause() $flag = False EndFunc Func Start() ;init() $flag = true EndFunc Func MainFunc() Sleep(100) $counter=$counter+1 ToolTip($counter) EndFunc ;==>Message Func Quit() exit EndFunc ;==>Quit This is the right approach. 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...
fisofo Posted November 19, 2009 Share Posted November 19, 2009 (edited) @Yashied Love the UDF so far! One thing, I have a specific window I am assigning hotkeys for, like this: Opt("WinTitleMatchMode", 2) _HotKeyAssign($VK_F1, 'CWDate', $HK_FLAG_EXTENDEDCALL, 'ConnectWise') _HotKeyAssign($VK_F2, 'CWDate', $HK_FLAG_EXTENDEDCALL, 'ConnectWise') _HotKeyAssign($VK_F3, 'CWDate', $HK_FLAG_EXTENDEDCALL, 'ConnectWise') _HotKeyAssign($VK_F4, 'CWDate', $HK_FLAG_EXTENDEDCALL, 'ConnectWise') ; For testing Func CWDate($iKey) MsgBox(0, "", Hex($iKey, 4)) EndFunc If I create a notepad document with "ConnectWise" in the title, it works fine, but the hotkey does not run at all for the program I want to use it for. Here's the program's window info: >>>> Window <<<< Title: My Activities - ConnectWise v8.0 Class: WindowsForms10.window.8.app.0.378734a Position: 1912, 86 Size: 1296, 1000 Style: 0x17CF0000 ExStyle: 0x00050100 Handle: 0x0000000000040840 >>>> Control <<<< Class: WindowsForms10.window.8.app.0.378734a Instance: 93 ClassnameNN: WindowsForms10.window.8.app.0.378734a93 Advanced (Class): [CLASS:WindowsForms10.window.8.app.0.378734a; INSTANCE:93] ID: 2689752 Text: Position: 158, 172 Size: 1110, 777 ControlClick Coords: 403, 278 Style: 0x56010000 ExStyle: 0x00010000 Handle: 0x0000000000290AD8 Running MsgBox(0, "", WinActive("ConnectWise")) as a test while on the window returns "1" like it should, and WinGetTitle("[ACTIVE]") returns "My Activities - ConnectWise v8.0" like it should, so I'm not sure why the hotkey is not working. I am running the latest (3.3.0.0), and I'm on Windows 7 x64. Any ideas? EDIT: It appears the issue is not the above code, but hotkeys for this program *in general*... I cannot get any hotkeys to respond on this window. I will investigate to see what else I can find, although if you have ideas, I'd love to hear them! Edited November 19, 2009 by fisofo Link to comment Share on other sites More sharing options...
fisofo Posted November 20, 2009 Share Posted November 20, 2009 I figured out that the main issue was that of permissions, my lower-privileged script could not execute on higher privileged windows. Despite that, I have run into problems with F1 - F4 not running the hotkeys assigned to them using this script when certain windows are open... I'm not sure why yet, but as soon as I use hotkeyset instead, they work fine. I'll have to dig into it more some other time as I've spent way too much time on this already, but I'll let you know if I ever figure out why... here's a snipet of the code I was testing though: ;~ _HotKeyAssign($VK_F1, 'CWDate') ;~ _HotKeyAssign($VK_F2, 'CWDate') ;~ _HotKeyAssign($VK_F3, 'CWDate') ;~ _HotKeyAssign($VK_F4, 'CWDate') HotKeySet("{F1}", "CWDate") HotKeySet("{F2}", "CWDate") HotKeySet("{F3}", "CWDate") HotKeySet("{F4}", "CWDate") The hotkeyset work all the time, the hotkeyassign only seem to work on specific windows for just these specific keys (F1 to F4) Link to comment Share on other sites More sharing options...
Splash Posted November 20, 2009 Share Posted November 20, 2009 Working on AutoIt 3.3.0.0, Windows XP Service Pack 2, Portuguese (Brazil) version. Thanks!!! Automatic Update UDF - IP Address UDF - WinPcap AutoIt _FindDevice()[font="Verdana"][size="2"]AutoIt Spanish/Brasil/World community!!![/size][/font]Use you wanna a dot.tk domain please use my link: Link to comment Share on other sites More sharing options...
ceoguang Posted January 11, 2010 Share Posted January 11, 2010 Why is there no "del" key? #include <HotKey.au3> Global Const $VK_DELETE = 0x2E _HotKeyAssign(BitOR($CK_CONTROL,$CK_ALT ,$VK_DELETE), 'MyFunc') While 1 Sleep(10) WEnd Func MyFunc() MsgBox(0, 'Test', 'pressed!') EndFunc ;==>MyFunc Link to comment Share on other sites More sharing options...
Yashied Posted January 11, 2010 Author Share Posted January 11, 2010 Why is there no "del" key? #include <HotKey.au3> Global Const $VK_DELETE = 0x2E _HotKeyAssign(BitOR($CK_CONTROL,$CK_ALT ,$VK_DELETE), 'MyFunc') While 1 Sleep(10) WEnd Func MyFunc() MsgBox(0, 'Test', 'pressed!') EndFunc ;==>MyFunc You can not block CTRL-ALT-DEL. 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...
ceoguang Posted January 11, 2010 Share Posted January 11, 2010 #Yashied Really? Then You can specify a hot key, any key, including the CTRL-ALT-DEL, F12, WIN-..., What does that mean? Link to comment Share on other sites More sharing options...
Yashied Posted January 11, 2010 Author Share Posted January 11, 2010 You can specify a hot key for CTRL-ALT-DEL but not block it. This is impossible in Windows NT-based systems (I think). Moreover there are no good reasons to do so. 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...
ceoguang Posted January 11, 2010 Share Posted January 11, 2010 Disappointing........ Link to comment Share on other sites More sharing options...
Mat Posted January 11, 2010 Share Posted January 11, 2010 Disappointing........I think its a very good idea. The amount of problems you could run into using something like BlockInput. AutoIt Project Listing Link to comment Share on other sites More sharing options...
fisofo Posted January 17, 2010 Share Posted January 17, 2010 (edited) Fyi, I'm guessing you know this, but in case you don't, compiling a script on the most recent autoit gives me this: HotKey.au3(194,56) : ERROR: Opt() called with illegal argument 1: "OnExitFunc" Global $OnHotKeyExit = Opt('OnExitFunc', 'OnHotKeyExit') EDIT: seems to work fine otherwise though! Edited January 17, 2010 by fisofo Link to comment Share on other sites More sharing options...
Mat Posted January 17, 2010 Share Posted January 17, 2010 Just change it to use OnAutoitExitRegister("OnHotkeyExit") AutoIt Project Listing Link to comment Share on other sites More sharing options...
Shafayat Posted February 16, 2010 Share Posted February 16, 2010 Here is the fix. This will work with the 3.3.4.0 Nothing changed really. Just thought this might help (other) noobs. Download - Hotkeyfixed.zip [Not using this account any more. Using "iShafayet" instead] 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