ReimuNotMoe / ydotool

Generic command-line automation tool (no X!)
GNU Affero General Public License v3.0
1.51k stars 79 forks source link

[KDE] [(x)Wayland] [ArchLinux] [MultiMonitor] Mouse pointer always moves to 0,0 only when using Absolute positioning. #195

Open TheoCGaming opened 1 year ago

TheoCGaming commented 1 year ago

Steps to reproduce:

  1. Compile latest ydotool from source
  2. sudo ydotoold
  3. sudo ydotool mousemove --absolute -x 300 -y 300
W-L commented 1 year ago

Same behaviour here on KDE neon 5.27. Irrespective of values given to -x or -y, the cursor always moves to top left. Any workarounds to fix this?

atolstoy commented 1 year ago

I've got the same issue, but the behaviour is different across the machines I tested ydotool on. On one of my laptops the absolute mouse placement works correctly, while on others it doesn't. I suspect that ydotool somehow can be unaware of screen dimensions in certain cases.

ClassicOldSong commented 1 year ago

Actually ydotool never aware of the current screen dimension. It's now a workaround for absolute positioning by moving mouse by a unlikely to happen negative value, thus result in the mouse to be at (0,0), then move by the given absolute value.

One possible solution is that ydotool creates a virtual absolute pointing device, but it still can't handle multiple displays automatically in this way.