WebView2CompositionControl.OnPreviewKeyDown(KeyEventArgs) Method

Definition

This is the "Preview" (i.e. tunneling) version of OnKeyDown(KeyEventArgs), so it actually happens first. Like OnKeyDown, this will only ever be called if we're explicitly forwarding key presses from the CoreWebView2. In order to mimic WPF's standard input handling, when we receive this we turn around and fire off the standard bubbling KeyDownEvent. That way others in the WPF tree see the same standard pair of input events that WPF itself would have triggered if it were handling the key press.

protected override void OnPreviewKeyDown (System.Windows.Input.KeyEventArgs e);
override this.OnPreviewKeyDown : System.Windows.Input.KeyEventArgs -> unit
Protected Overrides Sub OnPreviewKeyDown (e As KeyEventArgs)

Parameters

Applies to

See also