So you'd just have to set up/down/left/right using X/Y values, but that should work fine?
With Bangle.js it's a little more complicated as the Bangle always wants to have the HID services set up. You could just use NRF.setServices in your app, but then it'd only work if you ran the app and then paired the Bangle with another device, which is less than ideal.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hi! There is actually a joystick implementation that might do you? https://github.com/espruino/BangleApps/blob/master/apps/hidjoystick/app.js
So you'd just have to set up/down/left/right using X/Y values, but that should work fine?
With Bangle.js it's a little more complicated as the Bangle always wants to have the HID services set up. You could just use
NRF.setServices
in your app, but then it'd only work if you ran the app and then paired the Bangle with another device, which is less than ideal.So what happens is the relevant report descriptors are set in the bootloader code, and configurable from the settings app: https://github.com/espruino/BangleApps/blob/master/apps/boot/boot0.js#L7
Then when the app runs, it can check to see if HID is enabled, and if not it'll prompt the user: https://github.com/espruino/BangleApps/blob/master/apps/hidjoystick/app.js#L65