Sign in to follow this  
Followers 0
kredzio

Stopping MouseMove

25 posts in this topic

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...

Share this post


Link to post
Share on other sites



always MouseGetCursor gives me 0 because this isn't Windows cursor

Share this post


Link to post
Share on other sites

but this function starting when MouseMove has ended... I Need something for checking when MouseMove moving cursor...

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

this must be very short steps because this point is small, so this is not good idea :)

Edited by kredzio

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

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

Share this post


Link to post
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()

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

Maybe have an Adlib to check the color a little to lower right of the cursor ? :)

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

You're not looking for the cursor, you'll just be checking the pixel at the coordinates. Right ?

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

You don't understand my reasoning. If you take a screenshot of the screen, the cursor will be visible, right ? Why wouldn't pixelgetcolor work ?

Edited by Inverted

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#20 ·  Posted (edited)

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0