Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others


0 votes
in Technique[技术] by (71.8m points)

c# - Is there a way to disable CTRL + I, tab insertion in .NET UWP WebView

I am currently developing a UWP application and I have a WebView control, which a user interacts with. In this WebView, the user can format some text, and I would like for CTRL + I to apply italics formatting to any selected text.

When pressing CTRL + I the application formats the text (Which is handled using jQuery on the visited site), however, any selected text is replaced with a tab character.

I am aware that the CTRL + I keypress event results in keycode 9, which corresponds to a tab character, however, I am wondering if there is a way to disable this interaction?

I have tried intercepting both KeyDown and PreviewKeyDown events, however with no success. The events never fired, and I am assuming this is because I am entering text inside a webview. I also checked that the character is not inserted, when opening the visited page, using a normal web browser.

Below is the context of the webview.

    <!-- imports -->
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

        <WebView x:Name="Editor"

Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share