feat(terminal): add Capture toggle routing shortcut keys to the PTY #90

Merged
Claude-Run merged 1 commit from feat/VAPP-82-terminal-capture-toggle into main 2026-07-08 04:45:36 +02:00
Member

Mirror the Desktop Capture button (VAPP-49) on the Terminal toolbar. A new Capture toggle arms a capture signal and, on the wasm side, a set_capture method on TermHandle. While capture is on, xterm's attachCustomKeyEventHandler hook preventDefaults browser chord keys (Ctrl/Meta/Alt-modified keys and function keys like F5) and still returns true so xterm encodes the key and forwards it to the PTY; this is the always-available layer and the Firefox fallback. On Chromium the Keyboard Lock API (navigator.keyboard.lock()) is additionally engaged so browser-reserved keys (Ctrl+W/Ctrl+T) and Escape are captured in fullscreen; it is feature-detected via navigator.keyboard and a clean no-op elsewhere. Pressing Esc (or toggling off) releases capture, disarming interception and flipping the toolbar signal back to Off through an on-capture-off callback, matching the Desktop Esc-release behavior. The lock is also released on window blur and on teardown. The tooltip states the browser boundary: OS/WM keys (Alt+Tab, Super, Ctrl+Alt+F1) can never be captured by any browser.

Add a terminal_capture_guard test module that scans terminal.rs and fails the build if the toggle, custom key handler, preventDefault, Keyboard Lock engage/feature-detect, Esc-release, or the WM-key tooltip disappears, enforcing the invariants mechanically like the VAPP-80 detach guard.

#VAPP-82

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

Mirror the Desktop Capture button (VAPP-49) on the Terminal toolbar. A new Capture toggle arms a `capture` signal and, on the wasm side, a `set_capture` method on `TermHandle`. While capture is on, xterm's `attachCustomKeyEventHandler` hook `preventDefault`s browser chord keys (Ctrl/Meta/Alt-modified keys and function keys like F5) and still returns true so xterm encodes the key and forwards it to the PTY; this is the always-available layer and the Firefox fallback. On Chromium the Keyboard Lock API (`navigator.keyboard.lock()`) is additionally engaged so browser-reserved keys (Ctrl+W/Ctrl+T) and Escape are captured in fullscreen; it is feature-detected via `navigator.keyboard` and a clean no-op elsewhere. Pressing Esc (or toggling off) releases capture, disarming interception and flipping the toolbar signal back to Off through an on-capture-off callback, matching the Desktop Esc-release behavior. The lock is also released on window blur and on teardown. The tooltip states the browser boundary: OS/WM keys (Alt+Tab, Super, Ctrl+Alt+F1) can never be captured by any browser. Add a terminal_capture_guard test module that scans terminal.rs and fails the build if the toggle, custom key handler, preventDefault, Keyboard Lock engage/feature-detect, Esc-release, or the WM-key tooltip disappears, enforcing the invariants mechanically like the VAPP-80 detach guard. #VAPP-82 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
feat(terminal): add Capture toggle routing shortcut keys to the PTY
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 2m38s
Create release / Create release from merged PR (pull_request) Has been skipped
4a6f46f1fd
Mirror the Desktop Capture button (VAPP-49) on the Terminal toolbar. A new Capture toggle arms a `capture` signal and, on the wasm side, a `set_capture` method on `TermHandle`. While capture is on, xterm's `attachCustomKeyEventHandler` hook `preventDefault`s browser chord keys (Ctrl/Meta/Alt-modified keys and function keys like F5) and still returns true so xterm encodes the key and forwards it to the PTY; this is the always-available layer and the Firefox fallback. On Chromium the Keyboard Lock API (`navigator.keyboard.lock()`) is additionally engaged so browser-reserved keys (Ctrl+W/Ctrl+T) and Escape are captured in fullscreen; it is feature-detected via `navigator.keyboard` and a clean no-op elsewhere. Pressing Esc (or toggling off) releases capture, disarming interception and flipping the toolbar signal back to Off through an on-capture-off callback, matching the Desktop Esc-release behavior. The lock is also released on window blur and on teardown. The tooltip states the browser boundary: OS/WM keys (Alt+Tab, Super, Ctrl+Alt+F1) can never be captured by any browser.

Add a terminal_capture_guard test module that scans terminal.rs and fails the build if the toggle, custom key handler, preventDefault, Keyboard Lock engage/feature-detect, Esc-release, or the WM-key tooltip disappears, enforcing the invariants mechanically like the VAPP-80 detach guard.

#VAPP-82

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Run deleted branch feat/VAPP-82-terminal-capture-toggle 2026-07-08 04:45:36 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/vervain-apps!90
No description provided.