Fishcake
Fishcake

Reputation: 10774

Display touch keyboard in Windows 10 Store App

Whilst testing our Windows Store app developed for Windows 8/8.1 on Windows 10 we've discovered that tapping on a textbox doesn't display the touch keyboard.

I've created a new project to test this in using a textbox defined with the following XAML

    <TextBox x:Name="testTextBox" HorizontalAlignment="Left" Margin="469.901,314.495,0,0" InputScope="Number" 
             TextWrapping="Wrap" Text="" VerticalAlignment="Top" Height="37" Width="383" RenderTransformOrigin="0.5,0.5" 
             UseLayoutRounding="False" d:LayoutRounding="Auto"> 
    </TextBox>

It seems InputScope="Number" is having an effect because if I manually open the touch keyboard it is displaying the number keyboard however I can't get the touch keyboard to open when the textbox gets focus (ie. it is tapped on).

I have also tried setting this value through code as follows:

        InputScope scope = new InputScope();
        InputScopeName scopeName = new InputScopeName();
        scopeName.NameValue = InputScopeNameValue.Number;
        scope.Names.Add(scopeName);
        testTextBox.InputScope = scope;

UPDATE I've found there is a setting Tablet Mode which when turned on the touch keyboard does launch as I expected.

Upvotes: 2

Views: 4185

Answers (2)

Fishcake
Fishcake

Reputation: 10774

It turns out that the touch keyboard will only automatically display if the device is in Tablet mode.

How To Enable Tablet Mode

Upvotes: 5

Martin Tirion
Martin Tirion

Reputation: 1236

To explain: this is Continuum in Windows 10. The OS acts differently to the environment. There is a desktop-mode and a tablet-mode. It depends on the availability of touch and input devices like keyboard and mouse.

The on-screen keyboard only pops up automatically in Tablet mode. In desktop mode the user can popup the on-screen keyboard themselves by clicking the keyboard icon in the taskbar.

The user is in control :)

Martin

Upvotes: 2

Related Questions