Terminal: text input for IMEs, Capture browser keys, touch key row

- Desktop and web terminals use the text-input path too, so IMEs, dead
  keys, the emoji picker and dictation work; the key handler still
  encodes special keys and chords first (handled keys are never typed
  again), composing text is drawn at the cursor and sent on commit, the
  platform editable sits at the cursor, and a closed input reopens on
  the next key. The editable terminal is a semantics text field so web
  typing also works with semantics on.
- Web: "Capture browser keys" (terminal menu and right-click menu) goes
  full screen and calls navigator.keyboard.lock(); hold Esc to leave.
  No-op where unsupported; cheatsheet and menu note give alternatives.
- Touch: scrollable key row with sticky Ctrl/Alt (tap once, double-tap
  lock), Esc, Tab, arrows, Home/End, PgUp/PgDn and symbols through the
  hardware encoder; soft keyboard types per key (delete detection,
  Return as Enter); the line field moves behind the row's Line button.
- Capture kit: compose=, --semantics false, --user-agent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-26 02:43:57 +00:00
parent e526150b1e
commit c5af000453
36 changed files with 1730 additions and 173 deletions
@@ -131,6 +131,26 @@ void main() {
expect(actions, isNot(contains('Move between terminal tabs')));
});
test('a browser outside macOS documents capturing its keys', () {
List<String> actions(TargetPlatform platform, {required bool web}) => [
for (final entry in KeyboardShortcutRegistry(
platform: platform,
web: web,
).entries)
entry.action,
];
const action = 'Send browser keys to the terminal';
final entry = _entry(
const KeyboardShortcutRegistry(platform: TargetPlatform.linux, web: true),
action,
);
expect(entry.group, KeyboardShortcutGroup.terminal);
expect(entry.caveat, contains('Alt+Backspace'));
expect(entry.caveat, contains('hold Esc'));
expect(actions(TargetPlatform.macOS, web: true), isNot(contains(action)));
expect(actions(TargetPlatform.linux, web: false), isNot(contains(action)));
});
test('Search documents field-scoped Control navigation', () {
final registry = KeyboardShortcutRegistry(
platform: TargetPlatform.macOS,