Mobile World

Windows Phone 7 – Input

The Software Input Panel in Windows Phone 7 is entirely new. Unlike previous versions there will be a single SIP provider and device manufacturers will not be able to customise it. This means you can guarantee the same experience across different device types. With Windows Mobile there were some big differences between the input models of Standard Edition (Smartphone) and Professional Edition (Pocket PC) device types. We had the ability on Professional Edition devices to show or hide the sip and select from available input panels but no further control to customise the panel based on the input type required. For example to get a numerical keypad often required faking a screen press to “shift” the keyboard (unless your device had a specific keypad input panel).

Windows Phone 7 has a standard input panel but it does support different input contexts and will adjust accordingly. So if you mark a TextBox as requiring a Phone Number you’ll get a big numerical keypad. There are a number of different contexts supported, the UI guidelines document describes them but has some errors as the names do not match those you’ll see in Visual Studio and there are no examples of how to set them. I’ve tested a number of different InputScopeName values and have listed those below with a description of their behaviour (this effectively replaces the table on page 20 of the UI guidelines).

InputScopeName Layout
Default QWERTY
Text QWERTY with emoticons
EmailNameOrAddress QWERTY with .com and @ keys
TelephoneNumber 12-key phone pad
Url QWERTY with .com and “Go” enter key
Maps Not present
Search Same as Url – note this is not semi-transparent
SMS Address Not present – use TelephoneNumber

 

Along with these contexts there are others defined, most of which are the same or variations of the above. For example there are a number of numerical inputs such as CurrencyWithSymbol which has the QWERTY keyboard shifted to show numerals with common currency symbols (Dollar, Pound, Euro and Yen). All the ones I tried worked except for Xml which threw an unhandled exception. You can set the context easily in your XAML:-

Code Snippet
  1. <TextBox Height="31" HorizontalAlignment="Left" Margin="16,173,0,0" Name="textBox1" Text="TextBox" VerticalAlignment="Top" Width="449">
  2.     <TextBox.InputScope>
  3.         <InputScope>
  4.             <InputScope.Names>
  5.                                        <InputScopeName NameValue="EmailNameOrAddress"/>
  6.             </InputScope.Names>
  7.         </InputScope>
  8.     </TextBox.InputScope>
  9. </TextBox>

Posted Mar 22 2010, 12:37 AM by Peter Foot
Filed under:

Comments

Alberto Silva wrote Windows Phone 7 Series – (Mais e mais) Experiência(s) para programadores (V)
on 03-22-2010 16:36

A minha diponibilidade não me tem permitido meter as mãos na massa, a .NET Compact Framework 3.5 ainda

Nino.Mobile wrote The Mobile Minute 183
on 03-26-2010 9:15

The Mobile Minute 183

Catalin's Blog wrote Visual Studio 2010 Launch
on 04-12-2010 19:51

A fost azi (12) si nu numai peste balta, am avut (10) si noi un launch event organizat in colaborare

Copyright © 2010 APPA Mundi Limited. All Rights Reserved. Terms of Use and Privacy Policy.