3

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.

Downquark
  • 31
  • 1
  • 3

3 Answers3

1

Following the approach given in the question mouse -> raspberry -> computer, one solution could be to emulate an HID (Human Interface Device) with the Pi when connecting to the computer. So the Pi picks up all input coming from the mouse/keyboard, gets the info it needs (the certain action you intend to act upon), and relays all the input to the other computer faking to be a HID using it's GPIO ports.

See here (to not repeat what's written there):

Ghanima
  • 15,958
  • 17
  • 65
  • 125
0

You cannot do this directly because the Pi's USB port was occupied.

However you can use Arduino Leonardo with some SPI-to-USB-Host chip here.

Maxthon Chan
  • 1,051
  • 8
  • 14
-2

Here is what you need USB over IP. Your RPi will run Linux and do the thing =)

Alexey Vesnin
  • 926
  • 10
  • 17