Show soft input keyboard UWP C++/CX

913 views Asked by At

I have written my own UI framework in OpenGL, and am porting to Windows Universal Platform. At times, I need to show the soft input keyboard when the computer is in Tablet Mode when a user taps in one of my custom text boxes (NOT a XAML TextBox). Is there a way do this without a XAML TextBox?

Currently the app works by listening to the CharacterReceived event, but that only works with an attached keyboard.

I have also tried the following with no success:

Windows::UI::ViewManagement::InputPane^ ip = Windows::UI::ViewManagement::InputPane::GetForCurrentView();
bool result = ip->TryShow();
1

There are 1 answers

0
Dan On

As far as I know, InputPane is the method to use for a Windows Phone. For a tablet, the touch keyboard sample shows how to implement what I believe you're trying to achieve.

Note also, from that same page:

In Windows 10, the touch keyboard will not display automatically if a hardware keyboard is connected, or the PC is in Desktop mode and "Automatically show the touch keyboard in windowed apps when there is no keyboard attached to your device" in Settings -> Devices -> Typing is disabled.