Jump to content

Stopping MouseMove


Recommended Posts

i use MouseMove to moving cursor. And need stoped it when cursor change color to red... I can't use pixel search because in screen I have much thats same colors, but only when cursor roll on that item, cursor is changing... I must use pixel search to find when cursor change color to red and stopping their moving...

Link to comment
Share on other sites

hmm, well i dont know of a way to interrupt a mousemove command in progress but you could do the mousemove in a for next loop in short steps and do a pixel check in each step, if its done right it shouldn't be noticeable.

Thx all,Jack Dinn.

 

JD's Auto Internet Speed Tester

JD's Clip Catch (With Screen Shot Helper)

Projects :- AutoIt - My projects

My software never has bugs. It just develops random features. :-D

Link to comment
Share on other sites

well how fast do you want the mouse to move ? but i believe you can do it ok

MouseMoveEx(500,100)
Exit
Func MouseMoveEx($x,$y,$color=0)
    $step_devision=100
    $start=MouseGetPos()
    $x_steps=($x-$start[0])/$step_devision
    $y_steps=($y-$start[1])/$step_devision
    For $count=1 To $step_devision
    MouseMove($start[0]+($x_steps*$count),$start[1]+($y_steps*$count),1)
    $color_check=PixelGetColor(MouseGetPos(0),MouseGetPos(1))
    Next
EndFunc

this is set at mouse move speed 1 but if you change it to 0 then its fast and still checks the colour at each point, the steps are small enough to be as small as your mouse cursor is wide/high so should be ok but you can increase it as you like. also you might need to add or minus a little from the PixelGetColor(MouseGetPos(0),MouseGetPos(1)) MouseGetPos(0)+5 to get the point being checked in the middle of your cursor if you know what i mean.

only thing is that im not sure if pixelgetcolor actually picks up the cursor color, but worth a try.

Edited by JackDinn

Thx all,Jack Dinn.

 

JD's Auto Internet Speed Tester

JD's Clip Catch (With Screen Shot Helper)

Projects :- AutoIt - My projects

My software never has bugs. It just develops random features. :-D

Link to comment
Share on other sites

im not sure if this is what you want... but to stop the mouse from moving use

#Include <Misc.au3>
_MouseTrap()
Link to comment
Share on other sites

o dear i found that trying to find a changing mouse cursor color with an ID return of 0 is an unsolved problem read here

there must be something else you can be checking for other than the mouse cursor color?

Edited by JackDinn

Thx all,Jack Dinn.

 

JD's Auto Internet Speed Tester

JD's Clip Catch (With Screen Shot Helper)

Projects :- AutoIt - My projects

My software never has bugs. It just develops random features. :-D

Link to comment
Share on other sites

well Adlib is a good idea , i didn't think of that 1 , nice a simple solution but still leaves the same problem of how to find the cursor color. i dont c how checking the color "a little to lower right of the cursor" makes any difference if you cant get something to return the color of the cursor then it dont mater where you are doing the check.

Thx all,Jack Dinn.

 

JD's Auto Internet Speed Tester

JD's Clip Catch (With Screen Shot Helper)

Projects :- AutoIt - My projects

My software never has bugs. It just develops random features. :-D

Link to comment
Share on other sites

nop, the cursor color

i use MouseMove to moving cursor. And need stoped it when cursor change color to red.

thats the problem :)

well not my problem but interesting that i cant find a way to do this.

Thx all,Jack Dinn.

 

JD's Auto Internet Speed Tester

JD's Clip Catch (With Screen Shot Helper)

Projects :- AutoIt - My projects

My software never has bugs. It just develops random features. :-D

Link to comment
Share on other sites

ahh right a screen shot, where did you say that, i missed it.

yea that would work but you cant take a screen shot each few ms, well it might work but i kinda left that idea as overkill.

but if it works for the chap all good stuff.

its already been discussed and dismissed so im done on this one. http://www.autoitscript.com/forum/index.ph...hl=cursor+color

but hope it works out ok for ya Kredzio :)

Edited by JackDinn

Thx all,Jack Dinn.

 

JD's Auto Internet Speed Tester

JD's Clip Catch (With Screen Shot Helper)

Projects :- AutoIt - My projects

My software never has bugs. It just develops random features. :-D

Link to comment
Share on other sites

When i do screenshot cursor is visible because this isn't windows standard cursor. This is app cursor, so pixel searching i can do, but problem have with stopping mouse...

I must try this function... Thanks JackDinn

MouseMoveEx(500,100)
Exit
Func MouseMoveEx($x,$y,$color=0)
    $step_devision=100
    $start=MouseGetPos()
    $x_steps=($x-$start[0])/$step_devision
    $y_steps=($y-$start[1])/$step_devision
    For $count=1 To $step_devision
    MouseMove($start[0]+($x_steps*$count),$start[1]+($y_steps*$count),1)
    $color_check=PixelGetColor(MouseGetPos(0),MouseGetPos(1))
    Next
EndFunc
Link to comment
Share on other sites

i already mentioned a similar funtion James..... but i guess the OP doesn't want the easy way out

Link to comment
Share on other sites

Please explain how to use BlockInput stop the mouse from moving ( during a MouseMove() movement ) if the mouse cursor changes color to red ?

i use MouseMove to moving cursor. And need stoped it when cursor change color to red.

from first post Edited by JackDinn

Thx all,Jack Dinn.

 

JD's Auto Internet Speed Tester

JD's Clip Catch (With Screen Shot Helper)

Projects :- AutoIt - My projects

My software never has bugs. It just develops random features. :-D

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...