Sign in to follow this  
Followers 0
AnonymousX

[Solved] HotKeySet activating with no keys

6 posts in this topic

#1 ·  Posted (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 by AnonymousX

Share this post


Link to post
Share on other sites



HotKeySet("^{F12}","test") ; - Trigger test() when ctrl+F12 is pressed

While True
    Sleep(100); Continue running script
WEnd


Func test()
    MsgBox(0,"","hello")
EndFunc

 

1 person likes this

 

Spoiler

WinSizer 2.1 (01/04/2017) - Download - [ Windows Layout Manager ]
Folder+Program (12/23/2016) - Download - [ USB Shortcut Creator ]

 

Share this post


Link to post
Share on other sites
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.

1 person likes this

Share this post


Link to post
Share on other sites

I'm new to this, is there a way for me to mark this as solved? 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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 ]

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0