3

The Touch keyboard sample shows a way for developers to inform the system to display touch keyboard as user touch a custom control [probably in tablet mode]. It was remarked that

On the PC, you can request that the touch keyboard display for a custom control by implementing the TextPattern provider interface (ITextProvider) and the ValuePattern provider interface (IValueProvider). Not supported on Phone.

Does anyone know how to achieve the same thing on Windows 10 phones? As a side note, I wonder why there is such a disparity between desktop and phone. I thought Continuum works in any scenario.

Romasz
  • 29,662
  • 13
  • 79
  • 154
An Hoa
  • 1,207
  • 12
  • 38

1 Answers1

2

On phone you I think you should be able to do use InputPane and CoreWindow.CharacterReceived event. Subscribe to the event to know what key has been clicked and show/hide keyboard with InputPane's methods. A sample showing keystrokes can look like this:

public MainPage()
{
    this.InitializeComponent();
    Window.Current.CoreWindow.CharacterReceived += (s, e) =>
    {
        Debug.WriteLine($"Character received -> {e.KeyCode}");
        e.Handled = true;
    };
}

private void Button_Click(object sender, RoutedEventArgs e)
{
    InputPane pane = InputPane.GetForCurrentView();
    pane.TryShow();
}
Romasz
  • 29,662
  • 13
  • 79
  • 154