eHrgo Posted March 31, 2007 Posted March 31, 2007 Hi all, thanks for your time:I've just coded that little script, as you can see thats working great:#Include <Misc.au3> Global $spd=5 $esc=_IsPressed('1B') While $esc<>1 $esc=_IsPressed('1B') $left=_IsPressed('25') $right=_IsPressed('27') $up=_IsPressed('26') $down=_IsPressed('28') $enter=_IsPressed('0D') $pos=MouseGetPos() Select Case $left=1 MouseMove( $pos[0]-$spd, $pos[1],0) Case $right=1 MouseMove( $pos[0]+$spd, $pos[1],0) Case $up=1 MouseMove( $pos[0], $pos[1]-$spd,0) Case $down=1 MouseMove( $pos[0], $pos[1]+$spd,0) Case $enter=1 MouseClick ( 'left') EndSelect WendBut when you use it, and press for exemple : left arrow, it really send left arrow... its really a problem when i press enter to clic, it sometimes add carriage return of press whatever button.How can I disable key's normal function ?Thanks a lot Sorry for my Bad English.
Toady Posted March 31, 2007 Posted March 31, 2007 Thats the same topic i just posted about blocking keyboard input but not for the autoit program. Its annoying... www.itoady.com A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding
yxrkt Posted March 31, 2007 Posted March 31, 2007 hotkeyset() disables the keys normal function. replace this . $esc=_IsPressed('1B') $left=_IsPressed('25') $right=_IsPressed('27') $up=_IsPressed('26') $down=_IsPressed('28') $enter=_IsPressed('0D') with this. $esc=_IsPressed('1B') $left=hotkeyset('{left}') $right=hotkeyset('{right}') $up=hotkeyset('{up}') $down=hotkeyset('{down}') $enter=hotkeyset('{enter}')
jvanegmond Posted March 31, 2007 Posted March 31, 2007 hotkeyset() disables the keys normal function.You wish, that's a load of crap..HotKeySet github.com/jvanegmond
Helge Posted March 31, 2007 Posted March 31, 2007 hotkeyset() disables the keys normal function. Funny you refer to the helpfile, because to me that's at least what seems to be said in the helpfile...When you set a hotkey, AutoIt captures the key-press and does not pass it on to the active application...Oops, this reminds me of something...
jvanegmond Posted March 31, 2007 Posted March 31, 2007 Helge, I see why you are confused. When doing exactly as told, e.g. replacing the _IsPressed function by HotKeySet.. It does not work as expected. Run this piece of code and see what it does: #Include <Misc.au3> Global $spd=5 $esc=_IsPressed('1B') While $esc<>1 $esc=_IsPressed('1B') $left=hotkeyset('{left}') $right=hotkeyset('{right}') $up=hotkeyset('{up}') $down=hotkeyset('{down}') $enter=hotkeyset('{enter}') $pos=MouseGetPos() Select Case $left=1 MouseMove( $pos[0]-$spd, $pos[1],0) Case $right=1 MouseMove( $pos[0]+$spd, $pos[1],0) Case $up=1 MouseMove( $pos[0], $pos[1]-$spd,0) Case $down=1 MouseMove( $pos[0], $pos[1]+$spd,0) Case $enter=1 MouseClick ( 'left') EndSelect Wend github.com/jvanegmond
yxrkt Posted March 31, 2007 Posted March 31, 2007 oh jesus my lord. du e en kuk manadar. #Include <Misc.au3> Global $spd=5 $esc=_IsPressed('1B') While $esc<>1 $esc=_IsPressed('1B') $left=hotkeyset('{left}','ost') $right=hotkeyset('{right}','ost') $up=hotkeyset('{up}','ost') $down=hotkeyset('{down}','ost') $enter=hotkeyset('{enter}','ost') Wend func ost() $pos=MouseGetPos() Select Case @HotKeyPressed = '{left}' MouseMove( $pos[0]-$spd, $pos[1],0) Case @HotKeyPressed = '{right}' MouseMove( $pos[0]+$spd, $pos[1],0) Case @HotKeyPressed = '{up}' MouseMove( $pos[0], $pos[1]-$spd,0) Case @HotKeyPressed = '{down}' MouseMove( $pos[0], $pos[1]+$spd,0) Case @HotKeyPressed = '{enter}' MouseClick ( 'left') EndSelect endfunc
Helge Posted March 31, 2007 Posted March 31, 2007 (edited) @Manadar : I was only quoting his statement and not his code, and as far as I know it's not a load of crap.His code is, but not his statement.du e en kuk manadar.Just so that you know it Manadar... if ignoring the typo this would be translated into :"You are a cock Manadar" - For some reason I don't think he's thinking of the male chicken. Edited March 31, 2007 by Helge
jvanegmond Posted March 31, 2007 Posted March 31, 2007 (edited) oh jesus my lord. du e en kuk manadar. Lik me bolle reet en leer AutoIt sukkel. expandcollapse popupDim $spd=5 HotKeySet("{ESC}", "Terminate") HotKeySet("{LEFT}", "Left") HotKeySet("{RIGHT}", "Right") HotKeySet("{UP}", "Up") HotKeySet("{DOWN}", "Down") HotKeySet("{ENTER}", "Enter") While 1 Sleep(0xFFFFFF) WEnd Func Left() $pos=MouseGetPos() MouseMove( $pos[0]-$spd, $pos[1],0) EndFunc Func Right() $pos=MouseGetPos() MouseMove( $pos[0]+$spd, $pos[1],0) EndFunc Func Up() $pos=MouseGetPos() MouseMove( $pos[0], $pos[1]-$spd,0) EndFunc Func Down() $pos=MouseGetPos() MouseMove( $pos[0], $pos[1]+$spd,0) EndFunc Func Enter() MouseClick("Left") EndFunc Func Terminate() Exit EndFunc : Thanks Helge, for point that out.. Edited March 31, 2007 by Manadar github.com/jvanegmond
Paulie Posted March 31, 2007 Posted March 31, 2007 Lik me bolle reet en leer AutoIt sukkel. "Me lick struggle round crack and leather AutoIt"
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