The goal is to connect a mouse to my raspberry Pi, and have it connected to a computer (both linux and windows will be used). I want to have a LED light up whenever I use a right mouse click. So the input would be mouse -> raspberry -> computer. Where I want the raspberry to have a led light up on certain actions.
Ideally I'd be able to configure this for not only certain mouse actions, but also keyboard.
Thing is, I have no idea where to start. Or if it is even remotely possible at all. Most challenging thing I can imagine is connecting the pi as a input peripheral. So any advice is greatly appriciated.
EDIT: Ideally the Pi would be connected as an actual USB device with a USB cable. This is to best imitate a mouse/keyboard and it's latencies.