Add configurable keyboard routing#47
Merged
satoshi-szk merged 1 commit intoJul 1, 2026
Merged
Conversation
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
marked this pull request as ready for review
July 1, 2026 16:19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds configurable native keyboard routing for wxp-hosted WebViews.
WxpKeyboardRouting,WxpKeyboardKey, andWxpKeyboardDestinationWebView,Parent, andWebViewAndParentdestinationsWxpWebView::set_keyboard_routingandWebViewDispatch::post_set_keyboard_routingwkwebview/keyboard_routing.rshelper modulewebview2/keyboard_routing.rshelper moduleWhy
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 -- --checkcargo check --package wxpcargo check --package wxp --target x86_64-pc-windows-msvccargo test --package wxp --libManual 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.