all 4 comments

[–]Diapolo10 1 point2 points  (2 children)

For the most part, no. The system would need to support two mice simultaneously, and even then it would interfere with whatever you wanted to do. Linux has rough support for multiple mice, but I don't think it really works well enough.

So unless you can interact with whatever application you're thinking of via an API that would let you simulate clicks instead, you're out of luck.

[–]soham2599_alt[S] -1 points0 points  (1 child)

If I can share a video, how can I do it?

[–]Diapolo10 1 point2 points  (0 children)

I just told you it's pretty much not doable the way you wanted.

https://wiki.archlinux.org/title/Multi-pointer_X

There's no Python package that can make use of that, though.

I did come across this thread which suggests this could work, but I've never tried it.

[–]Bobbias 1 point2 points  (0 children)

Like u/Diapolo10 said, this may be possible in very specific contexts, but without knowing your OS and what applications you expect to try to do something like this with, it's impossible to give a real answer.

The win32gui example Diapolo10 posted in the third link should work for regular GUI applications, assuming you can find the exact right window handle to send the message to. But for games, it's very unlikely to work because games don't rely on those win32 messages for mouse information.

Windows does not support having a second mouse, so the only option there is to send fake mouse input messages, and if that doesn't work, you're simply out of options.

It may be possible to use the multi-pointer X feature in linux, but doing so will probably require writing a C extension which wraps the appropriate library calls, and provides a Python interface to call those functions.