noVNC/tests
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
..
assertions.js Fix broken Chai import 2025-09-08 16:47:31 +02:00
fake.websocket.js Let fake WebSocket handle large sends 2024-08-29 16:51:16 +02:00
playback-ui.js Also re-enable playback on failures 2023-04-04 17:02:57 +02:00
playback.js Consistently use "sentence case" style 2024-11-27 14:40:40 +01:00
test.base64.js Consistently use "sentence case" style 2024-11-27 14:40:40 +01:00
test.browser.js Add permissions-exclusive async clipboard 2025-10-21 16:21:55 +02:00
test.clipboard.js Add permissions-exclusive async clipboard 2025-10-21 16:21:55 +02:00
test.copyrect.js Consistently use "sentence case" style 2024-11-27 14:40:40 +01:00
test.deflator.js Manually load sinon and chai 2024-08-05 15:49:39 +02:00
test.display.js Drop Image data once rendered 2025-09-10 09:58:09 +02:00
test.gesturehandler.js Manually load sinon and chai 2024-08-05 15:49:39 +02:00
test.h264.js Consistently use "sentence case" style 2024-11-27 14:40:40 +01:00
test.helper.js Manually load sinon and chai 2024-08-05 15:49:39 +02:00
test.hextile.js Consistently use "sentence case" style 2024-11-27 14:40:40 +01:00
test.inflator.js Manually load sinon and chai 2024-08-05 15:49:39 +02:00
test.int.js Manually load sinon and chai 2024-08-05 15:49:39 +02:00
test.jpeg.js Consistently use "sentence case" style 2024-11-27 14:40:40 +01:00
test.keyboard.js Also test Ctrl+AltGr, as that is what browsers use 2025-01-15 12:43:44 +01:00
test.localization.js Manually load sinon and chai 2024-08-05 15:49:39 +02:00
test.raw.js Consistently use "sentence case" style 2024-11-27 14:40:40 +01:00
test.rfb.js Add permissions-exclusive async clipboard 2025-10-21 16:21:55 +02:00
test.rre.js Consistently use "sentence case" style 2024-11-27 14:40:40 +01:00
test.tight.js Consistently use "sentence case" style 2024-11-27 14:40:40 +01:00
test.tightpng.js Consistently use "sentence case" style 2024-11-27 14:40:40 +01:00
test.ui.js feat: add configurable `ignore_keys` setting to filter key events 2026-03-27 20:41:47 -05:00
test.util.js Manually load sinon and chai 2024-08-05 15:49:39 +02:00
test.wakelock.js Add tests for the wakelock feature. 2025-12-06 19:00:42 +11:00
test.websock.js Expose length of buffered WebSocket data 2025-09-10 10:20:20 +02:00
test.webutil.js Manually load sinon and chai 2024-08-05 15:49:39 +02:00
test.zlib.js Consistently use "sentence case" style 2024-11-27 14:40:40 +01:00
test.zrle.js Consistently use "sentence case" style 2024-11-27 14:40:40 +01:00
vnc_playback.html Consistently use "sentence case" style 2024-11-27 14:40:40 +01:00