ahaykal Posted July 14, 2010 Share Posted July 14, 2010 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 Link to comment Share on other sites More sharing options...
Tvern Posted July 14, 2010 Share Posted July 14, 2010 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. Link to comment Share on other sites More sharing options...
ahaykal Posted July 15, 2010 Author Share Posted July 15, 2010 this is my code here: expandcollapse popup#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 Link to comment Share on other sites More sharing options...
ahaykal Posted July 15, 2010 Author Share Posted July 15, 2010 After hours of work it finally worked Thanks for your help! Link to comment Share on other sites More sharing options...
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