stfields Posted June 23, 2004 Posted June 23, 2004 This is the code included in the help file plus the edit to remove unwanted functions ; Press Esc to terminate script, Pause/Break to "pause" Global $Paused HotKeySet("!a", "TogglePause") ;;;; Body of program would go here;;;; While 1 Sleep(100) WEnd ;;;;;;;; Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) WEnd EndFunc The TogglePause function is never being called when I hit the assigned hotkey. I really don't care what the hotkey is... but I didn't want Escape. I've tried: HotKeySet("!a", "TogglePause") HotKeySet("{TAB}", "TogglePause") HotKeySet("{!a}", "TogglePause") <--- just in case !a needed the brackets (didn't think it did) To verify that it enters the loop command, I have a Send(".") in the Pause loop and a Send("x") in the Body loop that I'll view via Notepad. I commented out the Tooltips because I didn't believe them to be necessary. I am having this run behind an application that doesn't minimize (It won't return control through Alt-Tab). That is just for reference in case that is the problem. I am understand that the HotKeySet should NOT pass the keypresses to the application unless I use the "capture" type functions. However, they still do pass. Any ideas what is amiss? Thanks in advance for whatever help you can offer.
stfields Posted June 23, 2004 Author Posted June 23, 2004 Aye. I am reluctant to divulge further info unless it would prove useful due to seeing another poster getting "flamed."
Valik Posted June 23, 2004 Posted June 23, 2004 Then the problem is likely the game is trapping the keys.
stfields Posted June 23, 2004 Author Posted June 23, 2004 (edited) I figured that since the keys were still being "echoed" on-screen, that they weren't being passed through. Is there a known work around? If not, thanks for replying so quick ***edit: typo*** Edited June 23, 2004 by stfields
tuape Posted June 23, 2004 Posted June 23, 2004 Hi, This works for me. Tried with the following code: Global $Paused HotKeySet("!a", "TogglePause") ;;;; Body of program would go here;;;; While 1 Sleep(1000) MsgBox(0,"Not Paused", "Not Paused") WEnd ;;;;;;;; Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) WEnd EndFunc Are you sure hotkey combination ALT + a is not reserved by some other application? Tuape
SlimShady Posted June 24, 2004 Posted June 24, 2004 Hi, This works for me. Tried with the following code: Global $Paused HotKeySet("!a", "TogglePause") ;;;; Body of program would go here;;;; While 1 Sleep(1000) MsgBox(0,"Not Paused", "Not Paused") WEnd ;;;;;;;; Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) WEnd EndFunc Are you sure hotkey combination ALT + a is not reserved by some other application? TuapeI can confirm: this works here too.
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