AnonymousX Posted January 26, 2017 Share Posted January 26, 2017 (edited) Hello, My ultimate goal is have my program running in the background, then when user press some hotkey it will activate my function. I'm having issues though where function actives without me hitting anything though. I tried to make a simple test file to figure out whats going on but I'm stuck. HotKeySet("^{F12}",test());Trigger test() when ctrl+F12 is pressed While True Sleep(100); Continue running script WEnd Func test() MsgBox(0,"","hello") EndFunc When I run this I instantly get the message box saying hello, without hitting Ctrl+F12 which I want. What am I doing wrong here? Thanks for any help Edited February 7, 2017 by AnonymousX Link to comment Share on other sites More sharing options...
zone97 Posted January 26, 2017 Share Posted January 26, 2017 HotKeySet("^{F12}","test") ; - Trigger test() when ctrl+F12 is pressed While True Sleep(100); Continue running script WEnd Func test() MsgBox(0,"","hello") EndFunc AnonymousX 1 Spoiler WinSizer 2.1 (01/04/2017) - Download - [ Windows Layout Manager ]Folder+Program (12/23/2016) - Download - [ USB Shortcut Creator ] Link to comment Share on other sites More sharing options...
AnonymousX Posted January 26, 2017 Author Share Posted January 26, 2017 11 minutes ago, zone97 said: HotKeySet("^{F12}","test") ; - Trigger test() when ctrl+F12 is pressed While True Sleep(100); Continue running script WEnd Func test() MsgBox(0,"","hello") EndFunc Thank you! Didn't realize that's how the function worked. zone97 1 Link to comment Share on other sites More sharing options...
AnonymousX Posted January 26, 2017 Author Share Posted January 26, 2017 I'm new to this, is there a way for me to mark this as solved? Link to comment Share on other sites More sharing options...
czardas Posted January 27, 2017 Share Posted January 27, 2017 There used to be. If you edit the first post you can change the title to ''hotkeyset-activating-with-no-keys - SOLVED" or something like that. It's a good idea. operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
zone97 Posted January 27, 2017 Share Posted January 27, 2017 18 hours ago, AnonymousX said: Thank you! Didn't realize that's how the function worked. No problem. Spoiler WinSizer 2.1 (01/04/2017) - Download - [ Windows Layout Manager ]Folder+Program (12/23/2016) - Download - [ USB Shortcut Creator ] 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