You are reading a single comment by @tronic98776 and its replies. Click here to read the full conversation.
  • Thank you for your replay Robin.
    That is the correct tutorial I was referring to.

    I had thought that I may have reached the array limit on the tap(), but I'm unsure as I cannot find much detail about the function in documentation. I tried only sending the character's in small chunks, exectuing the function several times but this also failed:

    
    function sendNewTest() {
      NRF.sendHIDReport([2,0,4], function() {
      NRF.sendHIDReport([0,0,0]);
    });
      NRF.sendHIDReport([2,0,5], function() {
      NRF.sendHIDReport([0,0,0]);
    });
      NRF.sendHIDReport([2,0,6], function() {
      NRF.sendHIDReport([0,0,0]);
    });
      NRF.sendHIDReport([2,0,7], function() {
      NRF.sendHIDReport([0,0,0]);
    });
      NRF.sendHIDReport([2,0,8], function() {
      NRF.sendHIDReport([0,0,0]);
    });
      NRF.sendHIDReport([2,0,9], function() {
      NRF.sendHIDReport([0,0,0]);
    });
      NRF.sendHIDReport([2,0,10], function() {
      NRF.sendHIDReport([0,0,0]);
    });
      NRF.sendHIDReport([2,0,11], function() {
      NRF.sendHIDReport([0,0,0]);
    });
      
    }
    

    Also I found reference using the puck.js for keyboard inputs over BLE on another topic, where Gordon suggests it would be possible at the tend of his first paragraph:
    http://forum.espruino.com/conversations/­307801/

    The other confusing thing is (which could be due to my lack of JS knowledge), when sending fewer characters (say 3 for example), why does this work:

    
    > function sendCap() {
    >   // Send 'a'
    >   kb.tap(kb.KEY.A, 0, function() {
    >     // Followed by 'b'
    >     kb.tap(kb.KEY.B, 0, function() {
    >     // Followed by 'c'
    >     kb.tap(kb.KEY.C, 0);
    >     });
    >     });
    >   
    > }
    
    

    but not this?:

    
    > function myCommand() {
    >   kb.tap(kb.KEY.A, 0);
    >   kb.tap(kb.KEY.B, 0);
    >   kb.tap(kb.KEY.C, 0);
    > }
    
    

    Why is it that the tap() has to be nested like that?

About

Avatar for tronic98776 @tronic98776 started