0

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();
user1054922
  • 2,101
  • 2
  • 23
  • 37
  • Possible duplicate of [Showing touch keyboard on custom control](http://stackoverflow.com/questions/33437604/showing-touch-keyboard-on-custom-control) – Oleh Nechytailo Jan 03 '17 at 21:23
  • InputPane.TryShow() does nothing in Tablet Mode on Windows 10. – user1054922 Jan 04 '17 at 20:55
  • Did you disconnect the physical keyboard before testing it? It only works when physical keyboard is not connected AFAIK. – Sunius Jan 04 '17 at 21:00
  • Yep. The result of the method is still 'false'. In the InputPane documentation, it says: Note In some cases, overlay UI such as an InputPane is not fully supported. This includes: Microsoft DirectX apps in full-screen mode. – user1054922 Jan 04 '17 at 21:20
  • The software keyboard will not show if there is a keyboard attached. – Xie Steven Jan 05 '17 at 11:11
  • I put my computer in Tablet mode, disconnected my keyboard, and rebooted. The soft keyboard still would not show when calling this method and it returned 'false'. Is there a way to get a more descriptive error message/reason the soft input panel did not appear? – user1054922 Jan 06 '17 at 12:35

1 Answers1

0

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.

Dan
  • 333
  • 4
  • 12