RustDesk/flutter/lib/web
rustdesk 04faf21c78 feat: keyboard shortcuts in remote sessions
Add an opt-in keyboard-shortcut system that triggers session
actions (Send Ctrl+Alt+Del, Toggle Fullscreen, Switch Display,
Screenshot, Switch Tab, etc.) via three-modifier combinations
during a remote session.

Architecture
- Native: src/keyboard/shortcuts.rs intercepts at the encoder
  layer (process_event and process_event_with_session), so the
  feature is input-source-independent. Bindings persist as a
  single JSON blob in LocalConfig.
- Web: matching + keydown intercept live in the separate hand-
  written TS client at flutter/web/js/ (gitignored, not in this
  repo). flutter/lib/web/bridge.dart::mainInit registers
  window.onShortcutTriggered so the JS matcher can dispatch
  back into the active session's ShortcutModel; the bridge's
  mainReloadKeyboardShortcuts forwards to a JS reloadShortcuts
  on settings writes.
- Three-modifier prefix (Ctrl+Alt+Shift; Cmd+Option+Shift on
  macOS/iOS) sidesteps the need for a pass-through toggle.
- Flutter native path threads the explicit per-call SessionID
  for tab-precise routing; rdev path uses globally-current
  session.

UI
- Settings -> General -> Keyboard Shortcuts opens a dedicated
  configuration page; desktop and mobile share a body widget.
- Recording dialog with live capture, prefix validation, and a
  conflict-replace flow.
- Toolbar menu items display the bound shortcut inline.
- Default bindings (adapted from AnyDesk):
    +Del    Send Ctrl+Alt+Del
    +Enter  Toggle Fullscreen
    +Left/Right  Switch Display Prev/Next
    +P      Screenshot
    +1..9   Switch Session Tab

Other
- AGENTS.md: documented (a) flutter_rust_bridge_codegen needs
  a pinned version + Dart bridge wrappers should be hand-
  written, and (b) the Web-target split where flutter/web/js/
  is the runtime owner on Web rather than wasm-compiled Rust.
- 38 new i18n strings in src/lang/en.rs with Chinese
  translations in src/lang/cn.rs.

Refs discussion #1933.
2026-04-28 15:48:12 +08:00
..
plugin Refact. Build flutter web (#7472) 2024-03-22 13:16:37 +08:00
bridge.dart feat: keyboard shortcuts in remote sessions 2026-04-28 15:48:12 +08:00
common.dart refact: web, keyboard, translate mode (#9432) 2024-09-23 16:58:21 +08:00
custom_cursor.dart fix: web, reset cursor on disconn, back to main page (#9192) 2024-08-27 23:58:04 +08:00
dummy.dart web file transfer (#9587) 2024-10-12 09:03:13 +08:00
settings_page.dart remove mobile web setting, remove web/ios relay server setting (#9575) 2024-10-06 16:20:37 +08:00
texture_rgba_renderer.dart refact: flutter keyboard, map mode (#9160) 2024-08-24 12:10:36 +08:00
web_unique.dart web file transfer (#9587) 2024-10-12 09:03:13 +08:00
win32.dart Refact. Build flutter web (#7472) 2024-03-22 13:16:37 +08:00