WyrdNEXUS Posted June 20, 2010 Share Posted June 20, 2010 For some screwy reason, the pause and exit hotkeys work fine, but the others don't. I'm sure its just something stupid I'm doing wrong, and I've tried to shrink my code to make it less time-consuming to review. (Also as part of my troubleshooting process) At this point, I'm sure some fresh eyes can give me a nice quick smack in the face. expandcollapse popupGlobal $gloPAUSE = False HotKeySet("`", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("{LCTRL}1", "Trigger1") HotKeySet("{LCTRL}2", "Trigger(2)") While 1 sleep(100) WEnd Func Trigger1() MsgBox("ONE", "test", "well it got to 1") sleep(1000) EndFunc Func Trigger($x) MsgBox("TWO", "test", "it got to 2!") Sleep(1000) EndFunc Func TogglePause() $gloPAUSE = NOT $gloPAUSE if $gloPAUSE Then ToolTip('Script Paused',0,0) Sleep(1000) ToolTip("") Else ToolTip('Script Enabled',0,0) sleep(1000) ToolTip("") EndIf EndFunc Func Terminate() Exit 0 EndFunc Link to comment Share on other sites More sharing options...
Mat Posted June 20, 2010 Share Posted June 20, 2010 Try '^1' and '^2' instead of '{LCTRL}1' and '{LCTRL}2'. Some of the keys in the send syntax cannot be set as hotkeys. Mat AutoIt Project Listing Link to comment Share on other sites More sharing options...
WyrdNEXUS Posted June 20, 2010 Author Share Posted June 20, 2010 Try '^1' and '^2' instead of '{LCTRL}1' and '{LCTRL}2'. Some of the keys in the send syntax cannot be set as hotkeys.MatThanks... I knew I just needed a swift kick. Wow, I could have sworn I already tried that.The second function still doesn't work... well, I've learned the hard way that you can't pass args via HotKeys. Wonder why? Link to comment Share on other sites More sharing options...
Richard Robertson Posted June 20, 2010 Share Posted June 20, 2010 You can't because it doesn't work that way on Windows' side. If you want to differentiate between different hotkeys, don't try to send parameters. Just use the @HotKeyPressed macro to check. Link to comment Share on other sites More sharing options...
WyrdNEXUS Posted June 20, 2010 Author Share Posted June 20, 2010 Huh, thats interesting. So I could effectively create Hotkey's which trigger function params. Create a hotkey with a null handler (empty function) Switch for last hotkey pressed -> trigger function. Well... maybe. I'll toy around with it a bit and find out. Thanks! Link to comment Share on other sites More sharing options...
Richard Robertson Posted June 20, 2010 Share Posted June 20, 2010 Yes you can do that. 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