キーボードルーティング API を追加#46
Closed
satoshi-assistant wants to merge 1 commit into
Closed
Conversation
WebView 内の全キーをホストから奪うのではなく、製品側が選んだキーだけを親ウィンドウへ透過できるようにするため。
Contributor
Author
|
Closing this draft and recreating it. The implementation direction is still useful, and CI passed on macOS, Windows, and Ubuntu, but this PR is not merge-ready for two reasons:
I will open a replacement PR with an English commit/description and the refactored wry diff. |
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.
概要
WebView に届くキーボードイベントのうち、指定したキーだけを親ウィンドウへ透過する keyboard routing API を追加しました。
WxpKeyboardRouting/WxpKeyboardKey/with_keyboard_routingを追加WKWebViewのkeyDown:/keyUp:で対象キーを親NSViewへ転送WM_KEYDOWN/WM_KEYUP/WM_SYSKEY*を対象キーだけ親 HWND へ転送背景
plugin host では Space などの transport/global shortcut をホスト側に残したい一方で、その他のキーは WebView 内 UI のショートカットとして使いたいケースがあります。全キーをホスト優先にする API では WebView 側のショートカットまで失われるため、製品側が選んだキーだけを native event の段階で親へ渡せるようにしました。
確認
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 --lib手動確認が必要な点
ユニットテストでは routing rule の platform key code 変換までは確認できますが、実際に plugin host / DAW が native key event を transport shortcut として受け取ることまでは保証できません。CI の 3OS build/test 後、macOS/Windows の実ホストで Space などの指定キーがホストへ届き、その他のキーが WebView 側に残ることを手動確認する想定です。