Can xdotool position the mouse relative to current location?


Answer: 1

27 hours ago

Is there any way of choosing not a screen location, but a location relative to where it is?

For example, it could be xdotool mousemove +5 +0

Does this exist?

Added by: Freeman Prohaska

Answer: 2

9 hours ago

You'll find the answer in the xdotool man page:

   mousemove_relative [options] x y
       Move the mouse x,y pixels relative to the current position of the
       mouse cursor.

           Use polar coordinates. This makes 'x' an angle (in degrees,
           0-360, etc) and 'y' the distance.

           Rotation starts at 'up' (0 degrees) and rotates clockwise: 90 =
           right, 180 = down, 270 = left.

           After sending the mouse move request, wait until the mouse is
           actually moved. If no movement is necessary, we will not wait.
           This is useful for scripts that depend on actions being
           completed before moving on.

           Note that we wait until the mouse moves at all, not necessarily
           that it actually reaches your intended destination. Some
           applications lock the mouse cursor to certain regions of the
           screen, so waiting for any movement is better in the general
           case than waiting for a specific target.

In your case it will be:

xdotool mousemove_relative --sync 5 0
Added by: Kasandra Donnelly

Popular Search

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 1 2 3 4 5 6 7 8 9