# Possible to only adjust Y mouse coordinate?

Hey guys, sorry for what I can only feel is a silly question. I tried searching around but wasn't quite sure how to phrase it.

Is it possible to only adjust the Y axis relative to the absolute position? The macro I'm trying to setup has an X coordinate that is always going to vary. All I need is the mouse to always move vertically from where it currently is. I've been messing with it and it doesn't seem like I can leave the X coordinates blank in the move or click mouse function.

Hey Christopher,

I think your description is at odds with itself...Â

But I'll bite.

Give this a try:

-Chris

1 Like

Ha, you're right. Poorly worded question!

You solved my issue though. All I had to do was MOUSEX() and then the pixel that I need to get to vertically. Just in case anyone else ever stumbles upon it, here was the macro I created:

2 Likes

@ccstoneâ€™s example would be simpler as simply: â€śJust Move 0,20 relative to the current mouse locationâ€ť, but it sees he got you on to the right track with something along the lines of â€śJust Move MOUSEX(),57 relative to the absolute positionâ€ť

1 Like

True, but it assumes the initial position of the mouse is correct.

-Chris

Sure, but move absolute to MOUSEX(),MOUSEY()+20 is exactly the same as move relative to the mouse 0,20.

That canâ€™t be correct, can it?

If the mouse is at +13 and you said move +20 relative to the mouse, now you would be at +33.

If you tell the most to move to absolute position of +20 when the mouse is at +13, it will go to +20.

I could screen record a quick video to demonstrate. Because move to absolute position achieves what I need but move relative to mouse location cannot.

MOUSEX(),MOUSEY() is the current mouse location in absolute coordinates.

So move A,B relative to the current mouse location means the same as move absolute to MOUSEX()+A,MOUSEY()+B.

Correct.

And if you tell it to move to MOUSEY()+20, then you would also be at 33.

Yes, that is also correct. If you move to absolute position of 20, then it will go to 20. But if you move to absolute position of MOUSEY()+20, then it would go to 33 (if the mouse was at 13 to start with).

Correct, because you want to move to MOUSEX(),20, so you do need to use the move absolute.

My comment was only about Chrisâ€™s original action as posted above:

Which is better/simpler written as:

These two actions will always produce exactly the same result - neither of which is what you actually want, which is:

Hopefully that is clear.

Hey Peter,

Whups, you're right. I misremembered setting the initial X position.

I think I did that initially when I was testing.

-Chris

Hey Christopher,

I think the point is that:

A) The mouse-pointer must be moved to an I.P. (initial position).

B) Then movement relative to the current mouse position will work.

I failed to make point A crystal clear in my example above.

-Chris

Ah yes, in that case I fully agree that it would work the exact same.

I appreciate the help guys. The macro it helped me setup is very useful for me.