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.