erezlevi Posted December 25, 2007 Share Posted December 25, 2007 is there a way to write a scipt that waits for the key stroke : ctrl+alt+y to be pressed in any window, and then activate the rest of the script? Link to comment Share on other sites More sharing options...
Developers Jos Posted December 25, 2007 Developers Share Posted December 25, 2007 Just use HotKeySet() .... 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...
star2 Posted December 25, 2007 Share Posted December 25, 2007 Just use HotKeySet() .... that was the expert talking so u better take his words for it -- Jos has helped me a lot here's an example of what u want #include <guiconstants.au3> ; === no tray icon ==== TraySetState (2) ; ==== the hotkey set ==== HotKeySet ("^!y","activate") ; ======== creating the GUI ======= $the_GUI = GUICreate ("Test" , 150 , 80) ; =========== Create the buttons =============== $button = GUICtrlCreateButton ("Button" , 20 , 10 , 100, 25) $exit = GUICtrlCreateButton ("Exit" , 20 , 45 , 100, 25) ; ====== setting the GUI state ========= GUISetState (@SW_HIDE, $the_GUI) ; ====== looping ============== While 1 $msg = GUIGetMsg () ; ========= this event is for closing the program ======== If $msg = $gui_event_close Then Exit Select ; ==== buttons events ====== Case $msg = $exit Exit Case $msg = $button MsgBox (-1 , "test" , " this is a test") EndSelect WEnd Func activate() GUISetState (@SW_SHOW, $the_GUI) EndFunc [quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u] 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