Commit Graph

4 Commits

Author SHA1 Message Date
Taylor Jasko a06f2cf408 feat: add configurable `ignore_keys` setting to filter key events
Introduce a new `ignore_keys` setting that allows users to prevent
specific keyboard inputs from being forwarded to the remote VNC host
while still allowing the browser/client to handle them locally.

This addresses common UX issues where browser-level shortcuts (e.g.
Escape to exit fullscreen or F11 for fullscreen toggle) are also sent
to the VM, potentially interrupting workflows or triggering unintended
actions.

Key behavior:
- Keys listed in `ignore_keys` are handled locally & not sent to the VM
- Default value is to not ignore any key events
- Supports comma-separated input with whitespace tolerance
- Accepts aliases (e.g. "esc", "ctrl", "cmd") mapped to canonical codes
- Matching is case-insensitive and normalized

Implementation details:
- Centralized supported keys via `supportedIgnoreKeys`
- Added `normalizeIgnoreKey()` to map aliases to canonical codes
- Introduced `wrapRfbSendKey()` to intercept and filter outgoing key
  events
- Simplified `keyEvent()` to delegate to `rfb.sendKey`
- Added validation for user input with visual feedback on invalid
  entries
- Added dynamic tooltip and placeholder generation from supported
  key list

UI changes:
- Added `ignore_keys` input to settings panel
- Added tooltip with supported key examples
- Added inline validation styling for invalid entries

Tests:
- Added coverage for `shouldIgnoreKey()` including aliases,
  normalization, whitespace handling, and edge cases
- Added tests for wrapped `sendKey` behavior to ensure filtering works
- Updated `keyEvent()` tests to reflect pass-through behavior
- Added validation and helper function tests

This change improves usability when interacting with fullscreen mode
and other browser-level shortcuts, while remaining backward compatible.
2026-03-27 20:41:47 -05:00
Samuel Mannehed 14f9ea5880 Fix settings panel layout on small screens
Both labels and inputs protruded outside the panel on for example a
phone in portrait mode. This commit fixes that by allowing wrapping and
setting a max-width.

Since the --input-xpadding variable is now used in two different CSS
files, it was moved to constants.css.
2025-01-23 15:51:11 +01:00
Samuel Mannehed 3f29c9d993 Differentiate buttons from text inputs
By making buttons grey with bold text, they are easy to distinguish from
text inputs.
2025-01-23 15:39:19 +01:00
Samuel Mannehed 7603ced54e Create CSS variables for common noVNC-colors 2025-01-13 08:32:19 +01:00