Jump to content

Recommended Posts

Posted

Okay i have a question I should hope you will be able to help me.

Well I am using HotKeySet("!q", "Function1")

HotKeySet("!w", "Function2")

My question is that is there anyway to make it that when alt is still pressed and press "q",function1 occurs and then I press "w" while holding alt then function 2 will happen?

For example i press alt q while still holding alt, I press "w" then the second function happens?

What is happening now is that function1 happens when i release both alt and q. i want it to happen when i release q only?

Thank you for your help

Posted

A solution would be to set your hotkeys to just "q" and "w" and use _ispressed() inside the functions to check if alt is down.

There are probably better ways to do this, but it might get the job done.

Posted

this is my code here:

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.6.0
 Author:         myName

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here
#include<misc.au3> ;needed to capture keystrokes

HotKeySet("!q", "Numpad7")
HotKeySet("!w", "Numpad8")
HotKeySet("!a", "Numpad4")
HotKeySet("!s", "Numpad5")
HotKeySet("!z", "Numpad1")
HotKeySet("!x", "Numpad2")



While 1

    WEnd

Func _SendEx($ss,$warn = "")
     Local $iT = TimerInit()

     While _IsPressed("10") Or _IsPressed("11") Or _IsPressed("12")
         if $warn <> "" and TimerDiff($iT) > 1000 Then
             MsgBox(262144, "Warning", $warn)
         EndIf
       sleep(50)
     WEnd
     Send($ss)

EndFunc;==>_SendEx

Func Numpad7()

    _SendEx("{numpad7}")

EndFunc

Func Numpad8()
    _SendEx("{numpad8}")
EndFunc

Func Numpad4()
    _SendEx("{numpad4}")
EndFunc

Func Numpad5()
    _SendEx("{numpad5}")
EndFunc

Func Numpad1()
    _SendEx("{numpad1}")
EndFunc

Func Numpad2()
    _SendEx("{numpad2}")
EndFunc

where exactly should i put the _ispressed? thanks for your help

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...