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

  • regdog@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    16 days ago

    Does it need to be fully automatic, or does semi-automatic work for you?

    I am using input remapper to automate a few functions of my input devices. It only used it on my Plasma desktop, but it should work in all desktop environments.

  • edinbruh@feddit.it
    link
    fedilink
    English
    arrow-up
    2
    ·
    16 days ago

    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.

    • Zamundaaa@discuss.tchncs.de
      link
      fedilink
      English
      arrow-up
      3
      ·
      15 days ago

      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.

      • edinbruh@feddit.it
        link
        fedilink
        English
        arrow-up
        2
        ·
        15 days 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.

  • Zamundaaa@discuss.tchncs.de
    link
    fedilink
    English
    arrow-up
    2
    ·
    15 days ago

    xdotool should work the same in the Wayland session, assuming you give X11 apps the permission to emulate input. What about it isn’t working?

  • Tetsuo@jlai.lu
    link
    fedilink
    arrow-up
    1
    arrow-down
    10
    ·
    16 days ago

    There is a non-zero chance this post is a cheater asking on how to build a aimbot…