web-dev-qa-db-fra.com

Xdotool peut-il positionner la souris par rapport à l’emplacement actuel?

Existe-t-il un moyen de choisir non pas un emplacement à l'écran, mais un emplacement relatif à l'endroit où il se trouve?

Par exemple, il pourrait s'agir de xdotool mousemove +5 +0

Est-ce que ça existe?

4
Tim

Vous trouverez la réponse dans la xdotoolpage de manuel :

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

       --polar
           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.

       --sync
           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.

Dans votre cas ce sera:

xdotool mousemove_relative --sync 5 0
5
Sylvain Pineau