• OK I managed to solve my problem by calling NRF.sendHIDReportmanually.
    Now I have a first working gamepad implementation. Here is my script:

    var kb=require("ble_hid_keyboard");
    
    BTN_UP=D3;
    BTN_DN=D24;
    BTN_LEFT=D2;
    BTN_RIGHT=D22;
    BTN_B=D28;
    BTN_A=D25;
    var keys=[0,0,0,0,0,0,0,0];
    
    digitalWrite(D7,0);
    
    function onInit(){
      NRF.setServices(undefined, { hid : kb.report });
    
      setWatch("keys[2]=kb.KEY.UP;NRF.sendHIDReport(keys);", BTN_UP, {edge:"falling",repeat:true,debounce:50});
      setWatch("keys[2]=0;NRF.sendHIDReport(keys);", BTN_UP, {edge:"rising",repeat:true,debounce:50});
    
      setWatch("keys[3]=kb.KEY.DOWN;NRF.sendHIDReport(keys);", BTN_DN, {edge:"falling",repeat:true,debounce:50});
      setWatch("keys[3]=0;NRF.sendHIDReport(keys);", BTN_DN, {edge:"rising",repeat:true,debounce:50});
    
      setWatch("keys[4]=kb.KEY.LEFT;NRF.sendHIDReport(keys);", BTN_LEFT, {edge:"falling",repeat:true,debounce:50});
      setWatch("keys[4]=0;NRF.sendHIDReport(keys);", BTN_LEFT, {edge:"rising",repeat:true,debounce:50});
    
      setWatch("keys[5]=kb.KEY.RIGHT;NRF.sendHIDReport(keys);", BTN_RIGHT, {edge:"falling",repeat:true,debounce:50});
      setWatch("keys[5]=0;NRF.sendHIDReport(keys);", BTN_RIGHT, {edge:"rising",repeat:true,debounce:50});
    
      setWatch("keys[6]=kb.KEY.BACKSPACE;NRF.sendHIDReport(keys);", BTN_B, {edge:"falling",repeat:true,debounce:50});
      setWatch("keys[6]=0;NRF.sendHIDReport(keys);", BTN_B, {edge:"rising",repeat:true,debounce:50});
    
      setWatch("keys[7]=kb.KEY.ENTER;NRF.sendHIDReport(keys);", BTN_A, {edge:"falling",repeat:true,debounce:50});
      setWatch("keys[7]=0;NRF.sendHIDReport(keys);", BTN_A, {edge:"rising",repeat:true,debounce:50});
    
      setTimeout("digitalWrite(D7,1)",200);
    }
    

    Currently I only deal with 6 buttons. This is because the HID report can handle up to 6 buttons at a time.
    I will continue to work on it for some improvements and hopefully I will come back soon with some pictures and/or videos just for your curiosity and for my pleasure ;-)

About