Hi,

using Cachyos kde I've been making a python script that will move the mouse to a position -> click -> move mouse back to the original position. I can get this working with x11, but it fails with wayland.

Do you know any way to programatically move the mouse and click that works with wayland?

Thanks

you are viewing a single comment's thread
view the rest of the comments
[–] 2 points 1 month ago (1 child)

The proper way to programmatically move a cursor on Linux is using uinput.

Anything you were doing that worked in xorg and not in wayland was more akin to a weird remnant from the 80s than to an actual solution.

However, there will likely be full featured applications that already do whatever you were trying to do.

  • source
  • hideshow 2 child comments
  • [–] 3 points 1 month ago (1 child)

    uinput is not the proper way, it's emulating a hardware device.

    The remote desktop portal is the proper way. Even xdotool works through that.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 2 points 1 month ago*

    Interesting, I didn't know you could do that through the portal directly.

    I was only familiar with uinput because I have used it before to use a wiimote as a mouse, and for that you'd actually want to emulate a mouse.

  • source
  • parent