question

IDGO-6443 avatar image
0 Votes"
IDGO-6443 asked IDGO-6443 commented

UWP : Need to disable on-screen-keyboard on textbox click

UWP : Need to disable on-screen-keyboard on textbox click

Because I need to Invoke third Party on-screen-keyboard.

Tried Below Code....But I was not able to disable on-screen-keyboard.

 PreventKeyboardDisplayOnProgrammaticFocus="True" 

Both are getting Invoked Microsoft on-screen-keyboard and Third Party Keyboard.

Its not Working, But I tried ishittestvisible=false Its Working, But All Mouse Events are Blocked.

Any of the Solution is Fine..1. either disable on-screen-keyboard or 2.after making ishittestvisible=falseMouse Events Should Work.



windows-uwp
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

FayWang-MSFT avatar image
0 Votes"
FayWang-MSFT answered IDGO-6443 commented

Hello,

​Welcome to our Microsoft Q&A platform!


You can try to use CoreTextEditContext.InputPaneDisplayPolicy property, it indicates whether the input pane should be shown automatically when focus enters your text input control. The default value is Automatic, so the screen keyboard will display automatically, you can set it as Manual, and when you use InputPane.TryShow() method, the screen keyboard will display.

 CoreTextServicesManager manager = CoreTextServicesManager.GetForCurrentView();
 CoreTextEditContext   _editContext = manager.CreateEditContext();
 _editContext.InputPaneDisplayPolicy = CoreTextInputPaneDisplayPolicy.Manual;

Here is an official sample about how to control screen keyboard manually, you can refer to it.


· 7
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

 CoreTextServicesManager manager = CoreTextServicesManager.GetForCurrentView();
       CoreTextEditContext   _editContext = manager.CreateEditContext();
       _editContext.InputPaneDisplayPolicy = CoreTextInputPaneDisplayPolicy.Manual;

Above Code not working

Here is an official sample about how to control screen keyboard manually, you can refer to it.( FayWang-MSFT): This is Working but Mouse events are not working

How do i solve this Mouse Events and I Have Opened a New Post : uwp-need-close-button-in-customeditcontrol-and-mou.html


0 Votes 0 ·

InputPane.GetForCurrentView().TryHide(); : This will work but the problem is I will get a Flickring,

  1. Onscreen Keyboard

  2. Third Party Keyboard will also Come

  3. Then Onscreen Keyboard will Hide which is causing Flickering...

I dont wont Hide....I Need to permanently disable Onscreen Keyboard when my application is Working.



0 Votes 0 ·

Yes, the code I provided is only a small part, for the complete code, you need to refer to the official sample. If you set the InputPaneDisplayPolicy as Manual and don't call the _inputPane.TryShow(); method, the screen keyboard won't display when you click the textbox.

0 Votes 0 ·

Yes Mate....I did not call _inputPane.TryShow(); method, Yet it shows the onscreen keyboard...

 CoreTextServicesManager manager = CoreTextServicesManager.GetForCurrentView();
            var _editContext = manager.CreateEditContext();
    
             // Get the Input Pane so we can programmatically hide and show it.
            var _inputPane = InputPane.GetForCurrentView();
            _inputPane.Visible = false;
    
           
             _editContext.InputPaneDisplayPolicy = CoreTextInputPaneDisplayPolicy.Manual;

 https://docs.microsoft.com/answers/questions/14883/uwp-need-close-button-in-customeditcontrol-and-mou.html

So I started working on CustomEditControl ...Above is the link I just need mouse events to work....



0 Votes 0 ·

As per your Instructions I have downloaded the project from CustomEditControl



This CustomEditControl has disabled on-screen-keyboard, But it does not have Selection Text and Mouse Events...Kindly let me know how do I achieve this...

0 Votes 0 ·
Show more comments