autoITkinect 0 Posted February 11, 2011 hi all of autoIT developer is there any function to hold down a key? i want to hold down left direction key until i hold down right key it will release the left key? i use it to make a controller for racing game. thanks a lot before Share this post Link to post Share on other sites
Rogue5099 18 Posted February 11, 2011 (edited) HotKeySet("l", "HoldLeftKey") ;Can't use {LEFT} for some reason? HotKeySet("{ESC}", "_Exit") While 1 Sleep(100) WEnd Func HoldLeftKey() While 1 Send("{LEFT}") Sleep(100) If _IsPressed(27) Then ExitLoop WEnd EndFunc 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 Func _Exit() Exit EndFunc Edited February 11, 2011 by rogue5099 My projects: Inventory / Mp3 Inventory, Computer Stats Share this post Link to post Share on other sites