Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion src/utils/keyboard-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,13 @@ export class KeyboardAPI {
const buffer = Array.from(await this.getByteBuffer());
const bufferCommandBytes = buffer.slice(0, commandBytes.length - 1);
logCommand(this.kbAddr, commandBytes, buffer);
if (!eqArr(commandBytes.slice(1), bufferCommandBytes)) {

// Check if response matches expected command echo
// Some keyboards (e.g., RK-R65) may return responses with variations in format
const commandEchoMatch = eqArr(commandBytes.slice(1), bufferCommandBytes);
const isAlternateFormat = buffer.length >= 2 && buffer[1] === command;

if (!commandEchoMatch && !isAlternateFormat) {
console.error(
`Command for ${this.kbAddr}:`,
commandBytes,
Expand Down