Skip to content

Add RK-R65 keyboard support and improve response validation - #435

Open
sawambugu wants to merge 1 commit into
the-via:mainfrom
sawambugu:sawambugu-add-rk-r65-support
Open

sawambugu wants to merge 1 commit into
the-via:mainfrom
sawambugu:sawambugu-add-rk-r65-support

Conversation

@sawambugu

Copy link
Copy Markdown

Problem

The Royal Kludge R65 keyboard (VID: 0x342D, PID: 0xE481) was causing errors in VIA due to:

  1. Strict USB HID response validation rejecting valid keyboard firmware responses
  2. Missing support for alternate response formats from some keyboard firmware implementations

Solution

Enhanced the keyboard API command handler to accept multiple response formats:

  • Standard format: Direct echo of command bytes (existing behavior)
  • Alternate format: Response where response[1] contains the command ID (new)

This allows keyboards like the RK-R65 that implement firmware variations to work correctly while maintaining validation for truly malformed responses.

Changes

  • src/utils/keyboard-api.ts: Modified _hidCommand() method to validate responses more flexibly
    • Added alternate format check: buffer[1] === command
    • Maintains error detection for genuinely bad responses
    • Includes explanatory comments for future maintainers

Testing

Verified with Royal Kludge R65:

  • Keyboard is now properly detected in VIA
  • Key remapping works correctly
  • No false positive errors from firmware response variations
  • Maintains protection against actual protocol errors

Related

Users can now configure RK-R65 keyboards by sideloading the keyboard definition through VIA's Design tab.

- Add VIA v3 keyboard definition for Royal Kludge R65 (VID: 0x342D, PID: 0xE481)
- Include it in supported keyboards index
- Improve response validation to handle firmware variations
  - Accept alternate response formats from keyboards with different firmware
  - Reduces false positives for 'Receiving incorrect response' errors

Fixes: Keyboard definition loading errors and hardware communication issues

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant