TheAmazingRak Posted May 19, 2017 Posted May 19, 2017 Hi! I'm new in the AutoIt. I'm trying to make a hotkeys script, but one function does not works, like I'm want. I think it's "HotKeySet". It is not waiting for a key, it is just writing all hotkeys Case $msg = $button2 While 1 for $number = 1 To 76 Step +1 $letter = FileReadLine("charlist.txt", $number) HotKeySet($letter,reason($letter)) Next Func reason($letter) for $line=1 To 19 Step +1 if FileReadLine("hotkeys.txt", $line) = $letter Then $text = FileReadLine("hotkeys.txt", $line+1) Send($text) EndIf Next EndFunc WEnd What I did bad?
Moderators JLogan3o13 Posted May 19, 2017 Moderators Posted May 19, 2017 @TheAmazingRak your function needs to be outside the While/WEnd loop. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Danp2 Posted May 19, 2017 Posted May 19, 2017 1 hour ago, TheAmazingRak said: HotKeySet($letter,reason($letter)) Also, this syntax is incorrect. You'll need to change it to HotKeySet($letter,reason) and then use @HotKeyPressed within the function to get the key pressed. Latest Webdriver UDF Release Webdriver Wiki FAQs
TheAmazingRak Posted May 19, 2017 Author Posted May 19, 2017 I found this: http://stackoverflow.com/questions/16922274/which-was-the-key-pressed-in-hotkeyset-function and tomorrow I'll try to use it.
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