Key Pad Mode Reference
In the Key Pad mode a graphic key pad is displayed for user selection, for example:
The general implementation is as follows:
- Upload Key Pad images
- Start the Key Pad mode
- Receive a return code
The images used in the process need only be uploaded once for multiple use. A hash mechanism is provided to determine whether or not the images have already been stored on the STU tablet.
If required the message area can be changed while the tablet is in Key Pad mode.
Key Pad Type
Select the Key Pad type from one of the following:
Image Design
Define up to three Key Pad designs. Each design contains the images used for the Key Pad selection formatted for the type. An example of a KeyPad type 1 normal image is shown below followed by the corresponding keys pushed image.
Key Pad Type 1 Image Design
Item | Size (w * h) | Location (x,y) |
---|---|---|
Message Area | 800 * 64 | 0,0 |
Button No | Size (w * h) | Location (x,y) |
---|---|---|
1 | 240 * 119 | 30, 73 |
2 | 240 * 119 | 280, 73 |
3 | 240 * 119 | 530, 73 |
4 | 240 * 119 | 30, 202 |
5 | 240 * 119 | 280, 202 |
6 | 240 * 119 | 530, 202 |
7 | 240 * 119 | 30, 331 |
8 | 240 * 119 | 280, 331 |
9 | 240 * 119 | 530, 331 |
Key Pad Type 2 Image Design
Item | Size (w * h) | Location (x,y) |
---|---|---|
Message Area | 800 * 220 | 0,0 |
Button No | Size (w * h) | Location (x,y) |
---|---|---|
1 | 240 * 103 | 30, 234 |
2 | 240 * 103 | 280, 234 |
3 | 240 * 103 | 530, 234 |
4 | 240 * 103 | 30, 347 |
5 | 240 * 103 | 280, 347 |
6 | 240 * 103 | 530, 347 |
Key Pad Type 3 Image Design
Item | Size (w * h) | Location (x,y) |
---|---|---|
Message Area | 514 * 480 | 286,0 |
Button No | Size (w * h) | Location (x,y) |
---|---|---|
1 | 240 * 96 | 30, 30 |
2 | 240 * 96 | 280, 128 |
3 | 240 * 96 | 530, 246 |
4 | 240 * 96 | 30, 354 |
Key Pad Settings
Up to three Key Pad image designs can be stored. For each design supply:
Item | Description |
---|---|
Image design number | Image design number 1..3 |
Normal Key Pad screen | Image data includes normal buttons, initial message and background image |
Button pushed Key Pad screen | Image data includes pushed buttons and background image |
KEY Pad type | Type 1..3 |
KEYs Enabled setting | The bitmask (1..9) allows individual keys/buttons to be enabled (1) or disabled (0): Bit 0: key1 Bit 1: key2 Bit 2: key3 etc. |
Key Pad Mode Settings
Before entering Key Pad mode, the images and settings must be stored. The following options must be set when entering Key Pad mode:
Item | Description |
---|---|
Key Pad Screen Select | Select Key Pad screen design from pattern 1..3 |
Select Message id | Message Box screen to show after an image has been selected |
Key Pad Mode Return
UI Event Data reports the selected key number:
Item | Description |
---|---|
Key Pad Screen Select | Key Pad screen design from pattern 1..3 |
Selected Key Number | Key number 1..9 dependent on Key Pad type |
Key Pad Operation logic
API Reference
Function | Description |
---|---|
initializeKeyPad | Key Pad settings |
writeRomImage | Tablet write ROM functions |
setOperationMode | Select Key Pad mode |
Code illustration
Upload Image
Requires image descriptor with buttons enabled mask:
array<bool, 9> KeyPad::m_btnEnabled = { 1, 1, 1, 1, 1, 1, 1, 1, 1 };
romStartImageData = initializeKeyPad(encodingMode, pushed, m_layoutNum, m_layoutNum, m_btnEnabled);
Start Key Pad mode
OperationMode_KeyPad KeyPadMode{ m_layoutNum, 0 };
OperationMode opMode = initializeKeyPad(KeyPadMode);
tablet.setOperationMode(opMode);
Receive the UI Event
Decode the UI Event data from ReportHandler
onReport(EventDataKeyPad & e)
{
PostMessage(m_hWnd, WM_KEYPAD_RESULT, MAKEWORD(e.keyNumber, e.screenSelected), 0);
}
...
// Dialog callback
case WM_KEYPAD_RESULT:
{
keyNumber = LOBYTE(wParam);
screenSelected = HIBYTE(wParam);
}
...