Loading libraries/aoa/src/keyboard.ts +35 −35 Original line number Diff line number Diff line Loading @@ -267,10 +267,12 @@ export class HidKeyboard { 0x75, 0x08, // Report Size (8) 0x95, 0x06, // Report Count (6) 0x81, 0x00, // Input (Data, Array) 0xc0 // End Collection ] 0xc0, // End Collection ], ); static readonly REPORT_SIZE = 8; #modifiers = 0; #keys: Set<HidKeyCode> = new Set(); Loading @@ -295,17 +297,15 @@ export class HidKeyboard { this.#keys.clear(); } serializeInputReport() { const buffer = new Uint8Array(8); buffer[0] = this.#modifiers; updateReport(report: Uint8Array) { report[0] = this.#modifiers; let i = 2; for (const key of this.#keys) { buffer[i] = key; report[i] = key; i += 1; if (i >= 8) { break; } } return buffer; } } Loading
libraries/aoa/src/keyboard.ts +35 −35 Original line number Diff line number Diff line Loading @@ -267,10 +267,12 @@ export class HidKeyboard { 0x75, 0x08, // Report Size (8) 0x95, 0x06, // Report Count (6) 0x81, 0x00, // Input (Data, Array) 0xc0 // End Collection ] 0xc0, // End Collection ], ); static readonly REPORT_SIZE = 8; #modifiers = 0; #keys: Set<HidKeyCode> = new Set(); Loading @@ -295,17 +297,15 @@ export class HidKeyboard { this.#keys.clear(); } serializeInputReport() { const buffer = new Uint8Array(8); buffer[0] = this.#modifiers; updateReport(report: Uint8Array) { report[0] = this.#modifiers; let i = 2; for (const key of this.#keys) { buffer[i] = key; report[i] = key; i += 1; if (i >= 8) { break; } } return buffer; } }