Mar 20

image

Working with an on-screen keyboard has never been easier with a windows phone. It’s very context sensitive so when you click on a text box it automatically zooms in to the text box and opens up the on-screen keyboard unit. 

When you place a TextBox control on-screen and it has focus a Software keyboard for the touchscreen will pop-up. It’s important to be able to customize that keyboard to the types of input the user will be placing in that textbox with the Windows Phone, you can specify the input scope, which determines the keyboard layout for the software input panel (SIP). This provides the user with easy access to the expected input characters based on the application context.

Here are some of the common SIP layouts and the associated values that you specify in XAML or in application code. For application code, the enumeration values are in InputScopeNameValue.

 

 

 

 

Table of Touch Keyboard Layouts (SIP)

SIP layout XAML or enumeration value SIP description
Default Default, and other standard input scope values Standard QWERTY keyboard
Text Text Standard text with features such as autocorrect and text suggestion
Web Url User types a URL
E-mail address EmailSmtpAddress User types an e-mail address
E-mail name or address EmailNameOrAddress User types an e-mail name or address
Maps Maps User types a location to search for on a map
Phone number TelephoneNumber User types a telephone number
Search Search User types a search query
SMS contact NameOrPhoneNumber User types in the SMS To field
Chat Chat Text input that uses intelligent features such as abbreviations

 

Additional standard input scope values are also supported. For most value types the TextBox control displays the standard SIP layout. Some input scope values, such as Numbers, causes device  to display the first symbol page of the standard SIP layout. In addition, automatic capitalization is enabled on the SIP for some input scope values, where appropriate.

The following examples show how to set the input scope for a TextBox control.

XAML

<TextBox Text="Hello Don">
    <TextBox.InputScope>
        <InputScope>
            <InputScopeName NameValue="Url" />
        </InputScope>
    </TextBox.InputScope>
</TextBox>

C#

InputScope inputScope = new InputScope();
InputScopeName inputScopeName = new InputScopeName();
inputScopeName.NameValue= InputScopeNameValue.Url;
inputScope.Names.Add(inputScopeName);
textbox.InputScope = inputScope;