@Mark_Pyrizhok @sailsman63 Thanks for the suggestions. I was really aiming for something using an air mouse because of how inexpensive and ubiquitous they are. I might have to just go the route of trying to roll a custom driver. Although, I’m not sure if that’s possible because I don’t know how much of the processing is done on the device.
There is also the possibility of doing it with custom hardware, but I expect it would be near impossible to get users to build their own. I had built a prototype about a year ago, but don’t have a working example at the moment. For anyone who is interested, the parts I used were as follows. I ordered all of the parts on aliexpress for about $12 total.
- Arduino pro mini atmega328 (make sure you get one with a pre-installed bootloader)
- SPP-C Bluetooth serial pass-through
- Micro USB 5V 1A lithium battery charger board
- A LiPo battery from a RC copter kit.
There are many examples of handling standard serial input for Java, but if you don’t want to mess with that. You can use this excellent library to have it register with the OS as a joystick https://github.com/MHeironimus/ArduinoJoystickLibrary.
Actually, the joystick library could be used for many different types of custom hardware. You can send whatever values you want for the axes/button values and interpret them to mean whatever you want inside your app.
EDIT: I forgot to mention, if you want to use the joystick library, it has to be direct USB connection and not bluetooth. In that case you need to use arduino leonardo or “pro micro” instead of “pro mini”