The ID numbers of the CWT Compact with keyboard alpha-numeric keys are shown in the figure below.
Figure 33, CWT Compact alpha-numeric key ID numbers
The text input keys are statically mapped to execute the click action OnKeyAddText. This click action appends the character defined in KeyValue to a TextBox in the currently visible panel. In this way the id of the physical piezo key can be mapped to a character.
In the example below the physical key with Id 10 is mapped to input the character A, the key with Id 9 is mapped to input the character B, etc.
STN definition:
<Keyboard>
...
<Stn:KeyboardButton Id="5" KeyValue="F" MxStyle="{KeyboardInputButton}" ClickSound="\Storage Card\Media\Sound\Keyboard\F.wav"/>
<Stn:KeyboardButton Id="6" KeyValue="E" MxStyle="{KeyboardInputButton}" ClickSound="\Storage Card\Media\Sound\Keyboard\E.wav"/>
<Stn:KeyboardButton Id="7" KeyValue="D" MxStyle="{KeyboardInputButton}" ClickSound="\Storage Card\Media\Sound\Keyboard\D.wav"/>
<Stn:KeyboardButton Id="8" KeyValue="C" MxStyle="{KeyboardInputButton}" ClickSound="\Storage Card\Media\Sound\Keyboard\C.wav"/>
<Stn:KeyboardButton Id="9" KeyValue="B" MxStyle="{KeyboardInputButton}" ClickSound="\Storage Card\Media\Sound\Keyboard\B.wav"/>
<Stn:KeyboardButton Id="10" KeyValue="A" MxStyle="{KeyboardInputButton}" ClickSound="\Storage Card\Media\Sound\Keyboard\A.wav"/>
TFT Definition:
<Keyboard>
...
<TFT:PiezoKeyboardButton Id="5" KeyValue="F" MxStyle="{KeyboardInputButton}" ClickSound="\Storage Card\Media\Sound\Keyboard\F.wav"/>
<TFT:PiezoKeyboardButton Id="6" KeyValue="E" MxStyle="{KeyboardInputButton}" ClickSound="\Storage Card\Media\Sound\Keyboard\E.wav"/>
<TFT:PiezoKeyboardButton Id="7" KeyValue="D" MxStyle="{KeyboardInputButton}" ClickSound="\Storage Card\Media\Sound\Keyboard\D.wav"/>
<TFT:PiezoKeyboardButton Id="8" KeyValue="C" MxStyle="{KeyboardInputButton}" ClickSound="\Storage Card\Media\Sound\Keyboard\C.wav"/>
<TFT:PiezoKeyboardButton Id="9" KeyValue="B" MxStyle="{KeyboardInputButton}" ClickSound="\Storage Card\Media\Sound\Keyboard\B.wav"/>
<TFT:PiezoKeyboardButton Id="10" KeyValue="A" MxStyle="{KeyboardInputButton}" ClickSound="\Storage Card\Media\Sound\Keyboard\A.wav"/>
All keys that shall be used for character input are defined as in the examples above. Usually, one button is allocated as a delete button that erases the last appended character in the TextBox in the currently visible panel. The delete key is defined as a KeyboardButton with the Id that matches the physical position on the keyboard and the click action is set to OnKeyDeleteLast.
Example definition of the delete key with Ids 29, 30, and 31 and click action OnKeyDeleteLast for an STN display. Note that the definition uses 3 keys as the Backspace button in the overlay occupies three buttons.
<Stn:KeyboardButton Id="29" Click="OnKeyDeleteLast"/>
<Stn:KeyboardButton Id="30" Click="OnKeyDeleteLast"/>
<Stn:KeyboardButton Id="31" Click="OnKeyDeleteLast"/>
Figure 34, CWT Compact with keyboard, example