Skip to content

feat: Add keyboard layout and paste speed settings#122

Open
MichaelRyom wants to merge 2 commits intosipeed:mainfrom
MichaelRyom:upstream/feat-keyboard-settings
Open

feat: Add keyboard layout and paste speed settings#122
MichaelRyom wants to merge 2 commits intosipeed:mainfrom
MichaelRyom:upstream/feat-keyboard-settings

Conversation

@MichaelRyom
Copy link

Adds settings UI for selecting the target keyboard layout and adjusting
paste inter-key delay.

  • Keyboard layout selector: dropdown to choose the target machine's keyboard
    layout (used by the layout-aware paste system from PR2)
  • Paste speed control: slider to adjust inter-key delay from 1-200ms,
    useful for slower remote machines that drop keystrokes
  • Both added to the Settings submenu

Files:

  • browser/src/components/menu/settings/keyboard-layout.tsx (new)
  • browser/src/components/menu/settings/paste-speed.tsx (new)
  • browser/src/components/menu/settings/index.tsx (modified)

Depends on # (keyboard layouts).
https://github.com/MichaelRyom/NanoKVM-USB/tree/upstream/feat-keyboard-layouts

Replace ASCII-only CharCodes paste with layout-aware system supporting
76 keyboard layouts (US, UK, German, French, Nordic, Cyrillic, Arabic,
Greek, Hebrew, Georgian, Armenian, Thai, Vietnamese, and more).

Changes:
- Add layouts.generated.ts with 76 XKB-derived layout maps
- Add layouts.ts with browser Keyboard API auto-detection and
  event-based learning of character mappings
- Replace CharCodes-based paste with layout-aware pasteText()
  using modifier-first key sequence for Windows compatibility
- Add targetKeyboardLayout and pasteSpeed storage/atoms for
  future settings UI
- Add learnFromKeyEvent() to keyboard handler to improve
  auto-detection accuracy over time
Add two new settings to the Settings submenu:
- Keyboard Layout: dropdown to select target machine's keyboard
  layout from 76 available layouts (defaults to US)
- Paste Speed: slider control for keystroke delay (1-200ms) with
  preset buttons for common speeds

Both settings persist in localStorage and are used by the layout-
aware paste system.

Depends on: feat-keyboard-layouts branch
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