How To Set The Keyboard Input Scope For Windows Phone 7

Below is an instruction set to create a better input model for your Windows Phone 7 app by invoking the TextBox control. Enabling this capability will make the typing experience easier for your potential customers by using input scopes where appropriate.  It is a differentiator that can go a long way amidst similar Windows Phone 7 applications.

The on-screen keyboard can be used to input text on a Windows Phone, and it is deployed automatically when a TextBox control becomes active. Windows Phone has several context-specific on-screen keyboard layouts that you can use for application development including the keyboard types in the following table:

 

Keyboard Type Layout
Default Standard QWERTY layout
Text Standard layout with ASCII-based emoticons
E-mail Address Standard layout with .com and @ keys
Phone Number Typical 12-key layout
Web Address Standard layout with .com key and customized Enter key
Maps Standard layout with a customized Enter key
Search Semi-transparent layout with a Search and  .com key
SMS Address Standard layout with easy access to phone number layout

Here is how you would enhance that setting by assigning the keyboard input scope

To set the input scope

  1. Open any project and on MainPage.xaml, drag a TextBox control from the Toolbox onto the designer. You can also create a TextBox control directly using the following XAML code. You may position or scale the control based on your preference.

    <TextBox Height=”31″ HorizontalAlignment=”Left” Margin=”31,256,0,0″ Name=”textBox1″ Text=”TextBox” VerticalAlignment=”Top” Width=”423″ >

    </TextBox>

  2. In the XAML code, between the <TextBox></TextBox> tags, add the following code to set the input scope. For this example, the “Url” keyboard layout is selected and a .com key is exposed.

    <TextBox.InputScope>
    <InputScope>
    <InputScopeName NameValue=”Url”/>
    </InputScope>
    </TextBox.InputScope>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s