Why can't we subtract here?

Actions (v10.1.1)

Keyboard Maestro Actions.kmactions (1.2 KB)

This should subtract 10 from MOUSEX(). What do you want to subtract?

I want to calculate the distance of mouse movement.

As things stand, x1 and x2 will be identical. Can you give some context about what you're trying to achieve here?

1 Like

It's also not clear if he wants distances to be negative numbers if he moves the mouse left, or if he wants to calculate vertical/horizontal or just horizontal distances.

Because I have to move the mouse in the middle, this is a simplified step, if x2-x1 = 0 how to realize it?

I just want to calculate the horizontal distance

Okay. When do you want to measure the distance travelled? Do you want calculation to occur when the user clicks a button, or presses a key, or what?

Mouse Distance.kmmacros (40 KB)

Macro screenshot

Trigger the macro, move the mouse and click the left button.

1 Like

I was working on this idea, which reports the distance travelled each 1.0 seconds, and also shows that number as a horizontal bar graph in the progress window. I love using the Progress Bar for things like this.

While.kmactions (1.6 KB)

1 Like

Thank you

Thank you. I got it.

1 Like