Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

_IsPressed

$
0
0
AutoIt         
Local $hDLL = DllOpen("user32.dll") While True         If _IsPressed("47", $hDLL) Then                 ConsoleWrite("G")             While _IsPressed("47", $hDLL)                 Sleep(10)             WEnd         ElseIf _IsPressed("48", $hDLL) Then                 ConsoleWrite("H")             While _IsPressed("48", $hDLL)                 Sleep(10)             WEnd     EndIf WEnd DllClose($hDLL) Func _IsPressed($sHexKey, $vDLL = 'user32.dll')     Local $a_R = DllCall($vDLL, "short", "GetAsyncKeyState", "int", '0x' & $sHexKey)     If @error Then Return SetError(@error, @extended, False)     Return BitAND($a_R[0], 0x8000) <> 0 EndFunc

I managed to do that, the problem is that they a lot of resources in processor.

Se can do it in another way ?

Thanks.


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>