Here is what I have so far. It will start holding the key down when I press the button, due to the While 1 infinite loop, but pressing the button to release the key or exit doesn't work as its stuck in the loop.
How can I modify it so it holds the keydown but lets off when I press the right button ? If I get rid of the While 1 loop, pressing the button only sends 1 instance of the key, it doesn't hold it down like it should.
AutoItSetOption("WinTitleMatchMode", 2) ;#NoTrayIcon #include <GUIConstants.au3> #include <Date.au3> GUICreate("Basic GUI with Buttons", 205,200) GUICtrlCreateLabel ( "title goes here" , 270, 140, 200, 35 ) $Button6= GUICtrlCreateButton("Control DOWN", 20, 25, 150, 40) $Button7= GUICtrlCreateButton("Control UP", 20, 65, 150, 40) $Close= GUICtrlCreateButton("E&xit", 20, 105, 150, 40) $filemenu = GUICtrlCreateMenu ("Men&u") $Helpme = GUICtrlCreateMenuItem ( "&Help", $filemenu ) ------------------------------------------------------------------------ GUISetBkColor ( 0xFFFFFF ) GuiSetState (1) While 1 $msg = GUIGetMsg() Select Case $msg = $button6 While 1 Send("{a down}") ;Holds the A key down WEnd Case $msg = $button7 Send("{a up}") Keyup() Case $msg = $Close Exit EndSelect If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend
Edited by Valhalla1, 29 November 2010 - 11:24 PM.




