See here: http://www.espruino.com/Puck.js+Keyboard
var controls = require("ble_hid_controls"); NRF.setServices(undefined, { hid : controls.report }); setWatch(function() { // Play/stop music controls.playpause(); }, BTN, {repeat:true,edge:"rising",debounce:50});
Should do it.
@Gordon started
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.
See here: http://www.espruino.com/Puck.js+Keyboard
Should do it.