...sorry, could not let 'it' go before 'really' useable. I introduce(d) the single tilde (~) as shift-in/out char for special, non char-keys... and I have now to escape it as well: double-tilde (~~) means 'send one single tilde' (~). This gives you everything you need to hit all keys defined in Espruino ble_hid_keyboard - http://www.espruino.com/modules/ble_hid_keyboard.js - module defined in KEY as .KEY[<key>]. The modifiers are now on you... ;-) . Here we go with modified ._send(c):
, _send: function(c) {
if (c == "~") {
var sOP = this.string.indexOf("~",1); // shiftOutPos
if (sOP < 0) { throw "Unmatched tilde (~) around ..."
+this.string.substring(0,5); }
if (sOP > 1) { c = this.string.substring(1,sOP); }
this.string = this.string.substring(sOP); }
kb.tap(kb.KEY[c],0,this._sent.bind(this));
}
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.
...sorry, could not let 'it' go before 'really' useable. I introduce(d) the single tilde (~) as shift-in/out char for special, non char-keys... and I have now to escape it as well: double-tilde (~~) means 'send one single tilde' (~). This gives you everything you need to hit all keys defined in Espruino
ble_hid_keyboard
- http://www.espruino.com/modules/ble_hid_keyboard.js - module defined inKEY
as.KEY[<key>]
. The modifiers are now on you... ;-) . Here we go with modified._send(c)
: