taylansan Posted May 2, 2023 Share Posted May 2, 2023 Hello, I was checking to send control + C / A / V (copy / all / paste) and I found this topic: They said, they can have their key sticky sometimes. That's okay, that's not the problem. My question is: If I KEYDOWN, how can I check if that key is pressed and down? In the below small script you can see I used CTRL, but it can be any other key such as Alt or Shift. What condition should I write in the if statement so it will return true and I can see "Control is already down" in the console output? I will CTRLUP anyway, but I want to enter inside that if condition when the Ctrl is really down. Is there anyway to check this? Send("{CTRLDOWN}") If <condition to check if ctrl is really down> Then ConsoleWrite("Control is already down" & @CRLF) EndIf Send("{CTRLUP}") TY. Link to comment Share on other sites More sharing options...
Solution ioa747 Posted May 2, 2023 Solution Share Posted May 2, 2023 (edited) #include <Misc.au3> Global $hDLL = DllOpen("user32.dll") While 1 If _IsPressed("10", $hDLL) Then ;10 SHIFT key ConsoleWrite("Shift Key is down" & @CRLF) While _IsPressed("10", $hDLL) ;10 SHIFT key If _IsPressed("12", $hDLL) Then ;12 ALT key ConsoleWrite("SHIFT + ALT is down" & @CRLF) ElseIf _IsPressed("11", $hDLL) Then ;11 CTRL key ConsoleWrite("SHIFT + CTRL is down" & @CRLF) EndIf Sleep(150) WEnd ConsoleWrite("Shift Key is up" & @CRLF) EndIf Sleep(10) WEnd Edited May 2, 2023 by ioa747 re-corection taylansan 1 I know that I know nothing 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