>I am unsure about what you actual try to do but I suggest that you "uses mouse" and look into this unit. It offer a lot, I bet >also things that you searching for.
>It is unknown to me how far it is compatible to your target.
I can use mouse for the mouse position, but I am unable to detect mouse clicks. This is the reason of the request. I am unable to find this information/examples. I can find the solution for Windows, but I would like it to be solved for Raspbian on PI, or even better cross platform.
I need to create a dual headed computer(like a PI4), one monitor, one primary keyboard and a primary mouse are the real hw, normal stuff.
On the same computer, but on the second monitor, I will have the output of a frame grabber "showing" the monitor of a target(another) computer.
I would like to setup a second keyboard and a second mouse on the dual headed computer, completely independent from the target but also independent from the primary keyboard and the mouse, they need not to interfere each other.
Connecting two keyboards and two mouses won't work because:
1) I cannot detect events from one particular keyboard or mouse connected
2) They are free to go from one monitor to another, I want them to be restricted to their monitors.
On the dual headed computer I will record macro events from the keyboard and mouse, and will generate the clicks and the keystrokes using a couple of devices (like 2 PI zero W) that will regenerate the events for the target computer using USB gadget keyboard and mouse emulation.
I could use a Teensy and or Arduino Nano but the PI Zero W would allow easier control. This is for the "regeneration" of the events captured but I would like to capture keyboard and mouse on the dual headed computer.
Apparently, It would be like you are using the target computer from the dual headed because the monitor will be replicated and the secondary keyboard and secondary mouse events will be captured on the dual headed computer and regenerated using the keyboard and mouse emulation provided by USB gadget.
I have one PI2 that could run just a Lazarus program that will transfer the mouse coordinates and button clicks to the dual headed computer but I am unable to extract mouse click information.
Hope it is more clear (not easy at all).
Giuseppe