Guidance on choosing HID mouse library

Hello everyone,

Thank you for reading.

The project I’m working on, is to create an air mouse for people with repetitive strain injury (since I have it as well). I’m flexible with the hardware required. The plan is to use data from an IMU for movement. I’m currently learning how to work with the sensor.

I have also been researching how to eventually convert the sensor data to mouse movements. I understand that you can do this over Bluetooth (Bluetooth HID, or HID over GATT). However, this is where I reach my limits.

I was really hoping to find a library, which can do this for me (similar to the mouse.h library) as it feels like it would take me months learning about the Bluetooth standards to try to implement it myself.

The options I found in my research: - https://github.com/cyborg5/BLE52_Mouse_and_Keyboard (adafruit boards only library so ties you to their ecosystem) - https://github.com/tcoppex/mbed-ble-hid (mbedOS library, code seems different then the arduino sketches I’ve seen so far and is difficult to understand) - https://github.com/asterics/esp32_mouse_keyboard (esp32 based library, would need to learn how to use that processor and not sure if supported properly in arduino IDE) - https://www.arduino.cc/en/Reference/ArduinoBLE (Arduinoble.h library, would you need to create the mouse HID profile from the ground up)

I looked through the source files of these libraries and couldn’t understand most of it. I’m really stuck. It would take me considerable time to try and implement even one of these options, and only then I can find out how good their library is (e.g. how it translates to actual experience of using a mouse).

Since many of you are much more experienced than me, I would be grateful for any guidance on how to proceed. Would you show a preference for any of the options above? Or should I be attempting to do things differently, e.g. without a mouse library (but where would I start)?

PS. In case it’s useful, I have basic familiarity with C++ (e.g. I understand classes, pointers, etc.), but I don’t have a programming background. I have done a few simple arduino projects and most of the examples on the official website.

As far as I know there's very little difference in programming between an Arduino and ESP32. All you need to do is install the add-on which is no different to installing any other library in the IDE.

This one looks pretty easy to understand and is well documented. https://github.com/T-vK/ESP32-BLE-Mouse.

I don't think you could modify an existing HID library without being a hard core programmer.

You could just copy this one.

https://www.reddit.com/r/arduino/comments/j17v14/i_made_a_bluetooth_hat_mouse_move_the_cursor_by/ https://github.com/jfedor2/hat-mouse

Thanks for both responses. I will explore the ESP version and the one you linked to. Still open to any other piece of wisdom from the community.

Just bumping in hopes of some additional advice/opinions from more experienced people.