Skip to content

Add configurable keyboard routing#47

Merged
satoshi-szk merged 1 commit into
novonotes:novonotes-internalfrom
satoshi-assistant:codex/keyboard-routing-api-v2
Jul 1, 2026
Merged

Add configurable keyboard routing#47
satoshi-szk merged 1 commit into
novonotes:novonotes-internalfrom
satoshi-assistant:codex/keyboard-routing-api-v2

Conversation

@satoshi-assistant

Copy link
Copy Markdown
Contributor

Summary

Adds configurable native keyboard routing for wxp-hosted WebViews.

  • Adds WxpKeyboardRouting, WxpKeyboardKey, and WxpKeyboardDestination
  • Supports WebView, Parent, and WebViewAndParent destinations
  • Adds runtime updates via WxpWebView::set_keyboard_routing and WebViewDispatch::post_set_keyboard_routing
  • Implements macOS routing in a small wkwebview/keyboard_routing.rs helper module
  • Implements Windows routing in a small webview2/keyboard_routing.rs helper module
  • Keeps product-specific timing decisions out of wxp; products can switch routing explicitly when their UI state changes

Why

Plugin hosts often reserve transport/global shortcuts such as Space, but WebView-based plugin UIs still need normal keyboard shortcuts and text input. A fixed “ignore all keys” strategy is too broad, and product-specific DOM focus heuristics do not belong in wxp. This adds a native routing primitive that products can configure and update intentionally.

The wry changes are split into helper modules so future upstream wry syncs have a smaller conflict surface.

Validation

  • cargo fmt --package host_window --package novonotes_run_loop --package run_loop_test_utils --package run_loop_timer --package wxp -- --check
  • cargo check --package wxp
  • cargo check --package wxp --target x86_64-pc-windows-msvc
  • cargo test --package wxp --lib

Manual validation still needed

Unit tests cover route-to-platform-code conversion, and CI covers 3OS compilation/tests. Actual host shortcut behavior still needs manual validation in plugin hosts/DAWs because tests cannot prove that a host consumes the forwarded native event as a transport shortcut.

Plugin hosts need to reserve selected native shortcuts without taking all keyboard input away from WebView-based UIs. The routing policy keeps that choice explicit and lets products update it at runtime.
@satoshi-szk
satoshi-szk marked this pull request as ready for review July 1, 2026 16:19
@satoshi-szk
satoshi-szk merged commit 0d956b2 into novonotes:novonotes-internal Jul 1, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants