Only gotcha is the Usage Maximum is 115 at the moment so I don't think you can send a key code larger than that. You could try adding the code from the module directly into your project, then modifying those Usage Maximum lines to 0xfb which seems to be the last key code defined, and then you could try sending key code 0xe8 (playpause) and see what happens?
If that actually works I could just modify the HID report to always include that
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.
I'm not 100% sure - you might be able to construct your own HID report (as at the top of http://www.espruino.com/modules/ble_hid_keyboard.js ) that does both but I'm not sure how.
However it might be that you can use a single type of device that does what you want.
So currently we have:
But looking at https://source.android.com/devices/input/keyboard-devices#hid-keyboard-and-keypad-page-0x07 it seems that code page 0x07 does normal keyboard stuff and volume/pause/etc.
And as far as I can tell, http://www.espruino.com/modules/ble_hid_keyboard.js is already using code page 7 (if you look further down the HID report)
Only gotcha is the
Usage Maximum
is 115 at the moment so I don't think you can send a key code larger than that. You could try adding the code from the module directly into your project, then modifying thoseUsage Maximum
lines to0xfb
which seems to be the last key code defined, and then you could try sending key code0xe8
(playpause) and see what happens?If that actually works I could just modify the HID report to always include that