Page 1 of 1

Click

Posted: 24 Sep 2017, 08:35
by Marcosa1020
Hello,
About Click,the smallest unit is 1 , can I use 0.5 for a unit ?
Like this : Click 100.5, 200.5
Thank you.

Re: Click

Posted: 24 Sep 2017, 08:42
by Helgef
Decimal parts are ignored, hence you will click 100, 200. Use round if you want the nearest pixel.

Re: Click

Posted: 24 Sep 2017, 09:02
by Marcosa1020
Helgef wrote:Decimal parts are ignored, hence you will click 100, 200. Use round if you want the nearest pixel.
Hi Helgef,
Thank you.

Re: Click

Posted: 24 Sep 2017, 10:33
by Marcosa1020
Hi,
How can I change to "Round" from "Click" ??
Thanks.

Code: Select all

1D_S1:
{
myArray1:=[508.5,499.5,489.5,479.5,470.5]
SetBatchLines -1
Send {Click, 11, 508, 2}
Sleep 2000
GuiControl,1:,card2,1
Loop, % myArray1.length()
{
Sleep %Slider%
Click % "11, " myArray1[A_Index] ", 2"  ; <----------- How can I change to "Round" from "Click" ??
Sleep 350
GuiControl,1:,card3,%A_Index%
}

Re: Click

Posted: 24 Sep 2017, 16:18
by Helgef
Click % "11, " round(myArray1[A_Index]) ", 2" :?:

Re: Click

Posted: 26 Sep 2017, 06:12
by Marcosa1020
Hi,

When I press once Win+Up Arrow then move 1 unit (I used the F3 to confirm). Could you tell me why is not 0.5 unit ?
Thank you.

Code: Select all

*#up::MouseMove, 0, Round(-0.5), 0, R  ; Win+UpArrow
*#Down::MouseMove, 0, Round(0.5), 0, R  ; Win+DownArrow
*#Left::MouseMove, Round(-0.5), 0, 0, R  ; Win+LeftArrow
*#Right::MouseMove, Round(0.5), 0, 0, R ; Win+RightArrow

F3::
MouseClick
MouseGetPos, xpos, ypos 
Msgbox, The cursor is at X%xpos% Y%ypos%. 
return

Re: Click

Posted: 26 Sep 2017, 18:47
by Marcosa1020
Helgef wrote:Click % "11, " round(myArray1[A_Index]) ", 2" :?:
Yes, Thank you.

Re: Click

Posted: 26 Sep 2017, 18:52
by Helgef
Hello. The MouseMove command moves the mouse in pixel units, you cannot move half a pixel.

Re: Click

Posted: 27 Sep 2017, 08:51
by Marcosa1020
Helgef wrote:Hello. The MouseMove command moves the mouse in pixel units, you cannot move half a pixel.
Yes, I original used MouseMove to move the cursor and then press F3 to know the current position.
Because I need to move the cursor slowly, do you know what other ways ?
Thank you so much.

Re: Click

Posted: 27 Sep 2017, 11:40
by Marcosa1020
Hi,
How can I move the cursor to (500, 508.7) (500, 498.7) (500, 488.7) ?
Thank you.

Code: Select all

F9::
myArray1:=[508.7,498.7,488.7]
SetBatchLines -1
Loop, 3
{
Click % "500, " round(myArray1[A_Index]) ", 2" ; The code is failure Click % "500, " round(myArray1, 1[A_Index]) ", 2"
}
return

Re: Click

Posted: 27 Sep 2017, 17:33
by Helgef
Your script works as I expect, it clicks at the specified coordinates. You might want to consider using coordMode if it doesn't click where you had hoped.
Cheers-

Re: Click

Posted: 04 Oct 2017, 07:17
by Marcosa1020
Helgef wrote:Your script works as I expect, it clicks at the specified coordinates. You might want to consider using coordMode if it doesn't click where you had hoped.
Cheers-
Hi,
I tried the following code, it will clicks at the (500,509) , (500,499) , (500,489). :headwall:
I also tried this code CoordMode( I'm not sure if I'm using the code correctly). :headwall:
Well, move half a pixel on the screen is impossible ?
Thank you.

Code: Select all

F9::
myArray1:=[508.7,498.7,488.7]
SetBatchLines -1
Loop, 3
{
Click % "500, " round(myArray1[A_Index]) ", 2"
}
return

Re: Click

Posted: 04 Oct 2017, 07:21
by Helgef
Your script looks ok and your report on its behaviour is what I would expect.
Well, move half a pixel on the screen is impossible ?
I am not familliar with the concept, sorry.

Good luck.

Re: Click

Posted: 04 Oct 2017, 07:52
by theimmersion
Lol, can you make a light bulb turn half on and half off? Pixel is essentially a light bulb turned either on or off (except in can be in colors). Just imagine the tip of your mouse being one pixel, how do you expect to be on a half pixel? So no, i dont think its possible at all. Good luck!

Re: Click

Posted: 04 Oct 2017, 08:05
by Marcosa1020
Hi Helgef, theimmersion,
Thank you.