Click

Get help with using AutoHotkey and its commands and hotkeys
Marcosa1020
Posts: 160
Joined: 23 Sep 2015, 19:15

Click

Post by Marcosa1020 » 24 Sep 2017, 08:35

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.

Helgef
Posts: 4477
Joined: 17 Jul 2016, 01:02
Contact:

Re: Click

Post by Helgef » 24 Sep 2017, 08:42

Decimal parts are ignored, hence you will click 100, 200. Use round if you want the nearest pixel.

Marcosa1020
Posts: 160
Joined: 23 Sep 2015, 19:15

Re: Click

Post by Marcosa1020 » 24 Sep 2017, 09:02

Helgef wrote:Decimal parts are ignored, hence you will click 100, 200. Use round if you want the nearest pixel.
Hi Helgef,
Thank you.

Marcosa1020
Posts: 160
Joined: 23 Sep 2015, 19:15

Re: Click

Post by Marcosa1020 » 24 Sep 2017, 10:33

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%
}

Helgef
Posts: 4477
Joined: 17 Jul 2016, 01:02
Contact:

Re: Click

Post by Helgef » 24 Sep 2017, 16:18

Click % "11, " round(myArray1[A_Index]) ", 2" :?:

Marcosa1020
Posts: 160
Joined: 23 Sep 2015, 19:15

Re: Click

Post by Marcosa1020 » 26 Sep 2017, 06:12

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

Marcosa1020
Posts: 160
Joined: 23 Sep 2015, 19:15

Re: Click

Post by Marcosa1020 » 26 Sep 2017, 18:47

Helgef wrote:Click % "11, " round(myArray1[A_Index]) ", 2" :?:
Yes, Thank you.

Helgef
Posts: 4477
Joined: 17 Jul 2016, 01:02
Contact:

Re: Click

Post by Helgef » 26 Sep 2017, 18:52

Hello. The MouseMove command moves the mouse in pixel units, you cannot move half a pixel.

Marcosa1020
Posts: 160
Joined: 23 Sep 2015, 19:15

Re: Click

Post by Marcosa1020 » 27 Sep 2017, 08:51

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.

Marcosa1020
Posts: 160
Joined: 23 Sep 2015, 19:15

Re: Click

Post by Marcosa1020 » 27 Sep 2017, 11:40

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

Helgef
Posts: 4477
Joined: 17 Jul 2016, 01:02
Contact:

Re: Click

Post by Helgef » 27 Sep 2017, 17:33

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-

Marcosa1020
Posts: 160
Joined: 23 Sep 2015, 19:15

Re: Click

Post by Marcosa1020 » 04 Oct 2017, 07:17

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

Helgef
Posts: 4477
Joined: 17 Jul 2016, 01:02
Contact:

Re: Click

Post by Helgef » 04 Oct 2017, 07:21

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.

User avatar
theimmersion
Posts: 181
Joined: 09 Jul 2016, 08:34
Location: Serbia

Re: Click

Post by theimmersion » 04 Oct 2017, 07:52

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!

Marcosa1020
Posts: 160
Joined: 23 Sep 2015, 19:15

Re: Click

Post by Marcosa1020 » 04 Oct 2017, 08:05

Hi Helgef, theimmersion,
Thank you.

Post Reply

Return to “Ask For Help”