Skip to content

feat: add Num Lock / Caps Lock toggle buttons in InfoBar - #1514

Open
nitishagar wants to merge 1 commit into
jetkvm:devfrom
nitishagar:feat/numlock-capslock-ui-toggle
Open

feat: add Num Lock / Caps Lock toggle buttons in InfoBar#1514
nitishagar wants to merge 1 commit into
jetkvm:devfrom
nitishagar:feat/numlock-capslock-ui-toggle

Conversation

@nitishagar

Copy link
Copy Markdown
Contributor

Summary

Adds interactive Num Lock and Caps Lock toggle buttons to the InfoBar. Previously the InfoBar only showed non-interactive lock-state indicators; there was no way to toggle the remote lock state from the UI.

Fixes #1464

Change

  • Turn the existing Caps Lock / Num Lock indicators into Buttons.
  • On click, send the lock-key scancode as a press+release pair via the existing keypressReport JSON-RPC path (the same backend handler the HID-RPC path reaches).
  • Each button's active state is bound to the remote LED state (keyboardLedState.caps_lock / .num_lock) — primary theme when on, light when off.

The button sends the raw scancode (like the e2e keyboard harness), not through the virtual-keyboard widget's keymap layer, so it is unaffected by the separately-reported virtual-keyboard Caps Lock issue.

Scope

UI-only. No backend/HID/gadget changes and no new state plumbing (reuses keyboardLedState).

Testing

  • npm run lint — passes (0 errors).
  • npm run build:device — passes (tsc + vite).
  • Added a device-gated e2e (ui/e2e/infobar-lock-toggles.spec.ts) that clicks each toggle and asserts the LED state flips via the existing waitForLedState harness. Runs where JETKVM_URL is set; skips gracefully otherwise.

Make the existing Num Lock and Caps Lock indicators in the InfoBar
interactive. Clicking one sends the lock-key scancode (press+release)
to the remote over the existing keypressReport path, and each button's
active state reflects the remote LED state from keyboardLedState.

The buttons send the raw scancode like the e2e keyboard harness does,
independent of the virtual-keyboard widget's keymap layer.

Fixes jetkvm#1464
@nitishagar
nitishagar marked this pull request as ready for review July 2, 2026 08:33
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.

UI Toggle for Num Lock and Caps Lock

1 participant