diff --git a/web/app.js b/web/app.js index 29eba0fd3..63a68ce0d 100644 --- a/web/app.js +++ b/web/app.js @@ -613,7 +613,8 @@ const PDFViewerApplication = { this.secondaryToolbar = new SecondaryToolbar( appConfig.secondaryToolbar, - eventBus + eventBus, + this.externalServices ); if (this.supportsFullscreen) { @@ -2917,6 +2918,10 @@ function webViewerKeyDown(evt) { case 80: // p PDFViewerApplication.requestPresentationMode(); handled = true; + PDFViewerApplication.externalServices.reportTelemetry({ + type: "buttons", + data: { id: "presentationModeKeyboard" }, + }); break; case 71: // g // focuses input#pageNumber field diff --git a/web/secondary_toolbar.js b/web/secondary_toolbar.js index a561ff170..b38bc2322 100644 --- a/web/secondary_toolbar.js +++ b/web/secondary_toolbar.js @@ -51,7 +51,7 @@ class SecondaryToolbar { * @param {SecondaryToolbarOptions} options * @param {EventBus} eventBus */ - constructor(options, eventBus) { + constructor(options, eventBus, externalServices) { this.toolbar = options.toolbar; this.toggleButton = options.toggleButton; this.buttons = [ @@ -150,6 +150,7 @@ class SecondaryToolbar { }; this.eventBus = eventBus; + this.externalServices = externalServices; this.opened = false; // Bind the event listeners for click, cursor tool, and scroll/spread mode @@ -212,6 +213,10 @@ class SecondaryToolbar { if (close) { this.close(); } + this.externalServices.reportTelemetry({ + type: "buttons", + data: { id: element.id }, + }); }); } }