Jump to content

Double Key Press with one-pressing another key


 Share

Recommended Posts

Hi guys :)
First of all, sorry for my bad english, i'm italian and so i'm not very good at explaning...
Anyway... I have to make an autoIT script that allows me to simulate a double tap (as fast as possible) even if i press a different key once. 
for example...
i press "e" 1 time (not holding it, but pressing it once) and it do "qq", and if i press q it works normally.
its possible? i have never scripted with autoIT (except once time, a long time ago, so i don't remember anything)
Waiting for answers :)
bye, Miggui

Link to comment
Share on other sites

Miggui, welcome to the forum.

Hope this fits your needs.

_HotKey("{ESC}")
_HotKey("e")
Func _HotKey($hotkey = "")
    Switch @HotKeyPressed
        Case "{ESC}"
            Exit 0 * MsgBox(64 + 262144, Default, "Exit", 1)
        Case "e"
            Send("qq")
        Case Else
            If Not IsDeclared("hotkey") Then Return MsgBox(16 + 262144, Default, "No CASE statement defined for hotkey " & @HotKeyPressed)
            If HotKeySet($hotkey, "_Hotkey") = 0 Then Return MsgBox(16 + 262144, Default, "Hotkey " & $hotkey & " invalid or set by another application.")
    EndSwitch
EndFunc   ;==>_HotKey

While Sleep(100) ; here should be your application.
WEnd ; meanwhile, here is a dummy loop.

App: Au3toCmd              UDF: _SingleScript()                             

Link to comment
Share on other sites

 

Miggui, welcome to the forum.

Hope this fits your needs.

_HotKey("{ESC}")
_HotKey("e")
Func _HotKey($hotkey = "")
    Switch @HotKeyPressed
        Case "{ESC}"
            Exit 0 * MsgBox(64 + 262144, Default, "Exit", 1)
        Case "e"
            Send("qq")
        Case Else
            If Not IsDeclared("hotkey") Then Return MsgBox(16 + 262144, Default, "No CASE statement defined for hotkey " & @HotKeyPressed)
            If HotKeySet($hotkey, "_Hotkey") = 0 Then Return MsgBox(16 + 262144, Default, "Hotkey " & $hotkey & " invalid or set by another application.")
    EndSwitch
EndFunc   ;==>_HotKey

While Sleep(100) ; here should be your application.
WEnd ; meanwhile, here is a dummy loop.

Thank you :)

the script does what i need... just somethimes doesn't work. so i did

Send("q")
Pause(5)
Send("q")

It's the same thing... 5ms of delay doesn't make any difference :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...