Jump to content
jackhab

HotKeySet("^{NUMPAD7}) does not release Ctrl

Recommended Posts

Hi
I created  a shortcut to send my email address:
 

HotKeySet("^{NUMPAD7}", "SendEmail")
Func SendEmail()
    Send("address@gmail.com")
EndFunc

I have an issue with Ctrl not releasing after pressing CtrlNum7, the text got sent but keyboard behaves as if I'm still holding Ctrl.

I tried to add Opt("SendKeyDelay", 50), and Sleep() before sending the text but it did not help.

So what am I doing wrong?

Share this post


Link to post
Share on other sites

It works for me, when i increase the Sleep inside _SendEmail()

HotKeySet("^{NUMPAD7}", "_SendEmail") ; NUMLOCK must be on
HotKeySet("{ESC}", "_Exit")
While True
    Sleep(100)
WEnd

Func _SendEmail()
    Sleep(250) ; <=== 
    Send("address@gmail.com")
    ConsoleWrite(@CRLF & "+ >>> Send('address@gmail.com')" & @CRLF)
EndFunc

Func _Exit()
    ConsoleWrite("! Terminated" & @CRLF)
    Exit
EndFunc

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Share this post


Link to post
Share on other sites

Better use this :

#include <Misc.au3>

HotKeySet("^{NUMPAD7}", "_SendEmail") ; NUMLOCK must be on
HotKeySet("{ESC}", "_Exit")
While True
    Sleep(100)
WEnd

Func _SendEmail()
    While _IsPressed ("11")
        Sleep (100)
    WEnd
    Send("address@gmail.com")
    ConsoleWrite(@CRLF & "+ >>> Send('address@gmail.com')" & @CRLF)
EndFunc

Func _Exit()
    ConsoleWrite("! Terminated" & @CRLF)
    Exit
EndFunc

 

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

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...