TheAmazingRak

HotkeySet isn't waiting for a key.

4 posts in this topic

#1 ·  Posted

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?

Share this post


Link to post
Share on other sites



#2 ·  Posted

@TheAmazingRak your function needs to be outside the While/WEnd loop.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#3 ·  Posted

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.

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