From 32a3b3ca2a6c402d3f9fd0715a403ff0b15e4af1 Mon Sep 17 00:00:00 2001 From: Richard Race <1273965+richrace@users.noreply.github.com> Date: Tue, 29 Aug 2023 16:52:30 +0100 Subject: [PATCH 1/2] Add click to copy the debug menu --- src/menu_items/debug.ts | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/menu_items/debug.ts b/src/menu_items/debug.ts index d3c63ab..770691d 100644 --- a/src/menu_items/debug.ts +++ b/src/menu_items/debug.ts @@ -2,7 +2,7 @@ import ProbeResult from 'arctis-usb-finder/dist/interfaces/probe_result'; import UsbDevice from 'arctis-usb-finder/dist/interfaces/usb_device'; import Probe from 'arctis-usb-finder/dist/use_cases/probe'; -import { MenuItem } from 'electron'; +import { MenuItem, clipboard } from 'electron'; function debugMenu(): MenuItem { const probe = new Probe(); @@ -37,13 +37,31 @@ function debugMenu(): MenuItem { if (foundHeadphones.length > 0) { probeMenuItems = foundHeadphones.reduce((menuItems, result: ProbeResult) => { + const path = result.device.path(); + menuItems.push({ label: result.device.realDevice().product, submenu: [ { label: `Product ID: ${result.device.productId}` }, - { label: `Bytes: ${result.matchedBytes}` }, - { label: `Report: ${result.matchedReport}` }, - { label: `Path: ${result.device.path()}` }, + { + label: `Bytes: ${result.matchedBytes}`, + click: () => { + clipboard.writeText(`Bytes: ${result.matchedBytes}`); + }, + }, + { + label: `Report: ${result.matchedReport}`, + click: () => { + clipboard.writeText(`Report: ${result.matchedReport}`); + }, + }, + { + label: `Path: ${path.slice(0, 50)}...`, + toolTip: `Path: ${path}`, + click: () => { + clipboard.writeText(`Path: ${path}`); + }, + }, ], }); From 23b192e14d6997c89efd706df7f34b5cd1b99211 Mon Sep 17 00:00:00 2001 From: Richard Race <1273965+richrace@users.noreply.github.com> Date: Tue, 29 Aug 2023 16:53:29 +0100 Subject: [PATCH 2/2] Update arctis-usb-finder --- package-lock.json | 12 ++++++------ package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 197003e..26d5dd2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "arctis-monitor", - "version": "0.0.6", + "version": "0.0.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "arctis-monitor", - "version": "0.0.6", + "version": "0.0.7", "license": "MIT", "dependencies": { - "arctis-usb-finder": "^0.0.15", + "arctis-usb-finder": "^0.0.16", "electron-squirrel-startup": "^1.0.0" }, "devDependencies": { @@ -1498,9 +1498,9 @@ "dev": true }, "node_modules/arctis-usb-finder": { - "version": "0.0.15", - "resolved": "https://registry.npmjs.org/arctis-usb-finder/-/arctis-usb-finder-0.0.15.tgz", - "integrity": "sha512-DbHt1k67TFBcVvOlCSKT63LaGAvR8+4IfZa4q0YuZZMRCfCEp9GmNkEpVmxvqVPvVCAHdn7GB2exXCzt+aM7Eg==", + "version": "0.0.16", + "resolved": "https://registry.npmjs.org/arctis-usb-finder/-/arctis-usb-finder-0.0.16.tgz", + "integrity": "sha512-s6ySRVez+kmRbjd1Su98rw9jM1kWcEykBr8AOyRdc+fTGcsAlh1YgYszvQSg/+yblc/LqVUDTv8pNt+PKm4rPw==", "dependencies": { "@types/node-hid": "^1.3.1", "node-hid": "^2.1.2", diff --git a/package.json b/package.json index a28bc23..30e51eb 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "typescript": "^5.0.4" }, "dependencies": { - "arctis-usb-finder": "^0.0.15", + "arctis-usb-finder": "^0.0.16", "electron-squirrel-startup": "^1.0.0" } }