moses-palmer / pynput

Sends virtual input commands
GNU Lesser General Public License v3.0
1.73k stars 243 forks source link

uinput: mouse support #332

Open tbm opened 3 years ago

tbm commented 3 years ago

Would it be possible to get mouse support via uinput?

moses-palmer commented 3 years ago

My initial aspiration when introducing the uinput backend was to fully implement both keyboard and mouse.

Unfortunately the way uinput works is very different from how pointing devices are presented by pynput. Whereas pynput, guided by the system implementations for the various backends, presents the pointing device as having screen coordinates which can be read and modified, and which sends events containing coordinates, uinput supports only events with what can be considered relative coordinates. I suspect those "relative coordinates" will be subject to transformation to account for pointer acceleration.

So, in short, the only parts of a mouse backend that could be implemented are press, release and move of the controller, and nothing of the listener.

I will however keep this issue open for future reference.

tbm commented 3 years ago

So, in short, the only parts of a mouse backend that could be implemented are press, release and move of the controller, and nothing of the listener.

That's really all I need (move the mouse and click).

But, yeah, it seems being on Wayland, I'm stuck right now. Maybe I'll set up a VM with X11.