0

I am not sure whether this is the correct stackexchange section.

I would like to find a solution to use a Raspberry Pi Zero 2 W in a chain like this: Bluetooth mouse/trackpad -> Raspberry Pi Zero 2 W with modified libinput and forwarding -> Standard mouse signals via USB -> Computer recognises a standard USB mouse

As first step I would like to connect a bluetooth-only mouse (Apple Magic Trackpad in my case) via USB to any computer, such that the computer detects a standard USB mouse.

As second step I would like to customize the processing on the Raspberry Pi, such that I can use a 3-finger-drag for example (as described here: https://blog.carsoncheng.ca/2021/02/enable-3-finger-drag-on-linux.html) I already do that successfully with the trackpad connected via Bluetooth on my private Linux computer using this modified libinput driver: https://github.com/aakside/libinput

I don't know where to start though and I feel I am lacking experience, so I am hoping for some of yours before I start. Some questions I have in mind are:

  • Would the Raspberry Pi Zero 2 W be suitable for this purpose?
  • Do you know of any projects implementing the recognition of a Raspberry Pi as USB mouse?
  • Do you know of any projects implementing the forwarding of bluetooth mouse signals to USB?
  • Would you expect any lag from forwarding the mouse control signals?

Thanks for all your ideas and inspiration!

4
  • 3
    What does this have to do with the Raspberry Pi?
    – NomadMaker
    Jun 9, 2022 at 21:05
  • Well, I expected this to be possible using a Raspberry Pi Zero. Do you have any experience with or know of any similar projects? If you think it is not possible, please let me know!
    – ben
    Jun 10, 2022 at 8:49
  • I edited the question, so that the general goal and the relation to the Raspberry Pi is more clear.
    – ben
    Jun 10, 2022 at 10:06
  • Do you know of any projects? is not a question about a Raspberry Pi problem
    – jsotola
    Jun 10, 2022 at 14:42

1 Answer 1

0

I am interested to build the exact same thing, so I can just have a USB hub or a docking station working with a magic trackpad 2, and any laptop just plug in without any reconfiguration. I dont have a solution, but hopefully I can help collect ideas and inspiration:

So far I tried connecting the trackpad directly to an linux machine with USB, this works quite well. (ubuntu 20.20)

Connecting bluetooth directly from the same linux machine to the magic trackpad 2, works, but the behaviour is different, it may be fixable: https://github.com/nexustar/linux-hid-magicmouse ( I haven't gotten around to test these yet)

as for the second part, I found a bluetooth relay project that connects both bluetooth to and from the raspberry pi: https://github.com/ruundii/bthidhub | https://forums.raspberrypi.com/viewtopic.php?t=282400

The closest solution I found is probably RaspiKey, but not sure if it handles mouse/touchpad: https://github.com/samartzidis/RaspiKey

Another way, I had been pondering to get this working would be with the Barrier software ( https://github.com/debauchee/barrier ) - I did however find this software to sometimes have a tiny bit of latency.

1
  • Hi @jbj, thanks for your answer and interest! I actually decided to go for an Arduino Micro + HC-05 Bluetooth module as I felt most confident to get the project done with that combination after all my research (and the fact that the Raspberry Pi Zero is currently quiet expensive or out of stock). You can find my thread in the Arduino forum here: forum.arduino.cc/t/… I just ordered all the components today, so it might still take a while until I actually get started.
    – ben
    Aug 14, 2022 at 17:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.