Danylo Liakhovetskyi
Danylo Liakhovetskyi

Reputation: 43

Make 2 cursors on the same PC using Java

My client has asked me to make software that allows him to use 2 mice with 2 cursors at the same time on a PC. He wants to be able to use this feature in a specific app that I don't have a code of. There're some programs that do what he wants (see here), but they all have some issues. Is it possible to do the same with Java? It seems I'll need some system-specific knowledge to do that, for example, if he uses Windows, it should be feasible to do that using C or C++. But I'm not sure. The best library I have found so far is jinput, but I only see how to use it inside a custom app, not throughout Windows.

Do you think it's possible to do using Java?

I'm a bit confused and may not explain everything correctly, but I hope it makes sense. Thank you

Upvotes: 0

Views: 375

Answers (1)

RAVN Mateus
RAVN Mateus

Reputation: 594

I can tell you for sure that it is not possible in Java. The reason for that is, that the MouseListener/MouseMotionListener/MouseWheelListener will most likely either reject the second mouse, or add combine the values of both mice into one. With writing native assembly code and remaking all Listeners and their interfaces it might be possible, but it would take an eternity and most likely come out extremely bug-prone. In other languages it might be easier but even then you will have to work with syscalls and do a lot of work at driver level. All in one, i would reject the job, no matter how much you are paid, it is not worth it.

Upvotes: 1

Related Questions