How to use only NumericPin keyboard into all application? UWP

1.2k views Asked by At

I developing an app in UWP, architecture 64x. With C#, W10 in kiosk mode.

I need to show and use only numeric keyboard for all input's into all application, but the keyboard provided by windows when i use InputScope="NumericPin" in TextBox element the NumericPin keyboard is showed, but when control lose focus for a moment the standard keyboard appears and disappears.

I already tried this, but it works just like what I have explained: https://msdn.microsoft.com/en-us/library/windows/apps/mt280229.aspx

I also considered use an external keyboard app service and it works perfectly, but my boss say it is the last resource. http://chessware.ch/virtual-keyboard/index.php

What i looking for is something like:

  • use the NumericPin keyboard as static in display every time.
  • the only keyboard layout available be NumericPin keyboard.

I finded this related question but says the same what me: UWP VirtualKeyboard shows NumericPin layout in simple textbox

Thanks for everybody.

1

There are 1 answers

1
Nico Zhu On

I need to show and use only numeric keyboard for all input's into all application, but the keyboard provided by windows when i use InputScope="NumericPin" in TextBox element the NumericPin keyboard is showed, but when control lose focus for a moment the standard keyboard appears and disappears.

As you said, the keyboard provided by windows and the type of keyboard is determined by InputScope property of input control. You could manually set InputScope property. However, you could not set keyboard for the input control that has not been determined InputScope property.

For your requirement, I think you could set global style for input control in Application.Resources. such as TextBox,RichEditBox etc.

<Application.Resources>
    <Style TargetType="TextBox">
        <Setter Property="InputScope" Value="NumericPin"/>
    </Style>
</Application.Resources>