5-6
ChCharacter Input Methods
Programmer’s Manual
application needs to specify the xy-coordinate of the upper left corner of the input
pad, the number of rows and columns of input boxes, and the size of each input
box (in units of pixel). If the input pad is not already opened by another application
and that the specified layout fits within the panning screen, it will be displayed at
the specified location ready for user’s input.
The area of the panning screen covered by the input pad is saved at the time this
function is called. Any changes to this covered area by the application after this
function is called will not be recorded by the system.
The default length of timeout for OpenInputPad() after the last stroke is 1sec.
STATUS
AdvOpenInputPad
(U16 xPos, U16 yPos, U16 numRow, U16
numCol, U16 areaWidth, U16 areaHeight, U16 echoCol, U16
echoWidth, U32 timeOut, U16 samplingRate, U8 areaClean, U16
stackSize)
AdvOpenInputPad is similar to the tool OpenInputPad but with advanced
configurable details. It allows the caller to specify:
position of the input pad
number of rows and columns of input boxes
the width and the height of the input boxes
the echo ink colour and dot width
the length of time out after a stroke(no more than 1sec)
the sampling rate of the pen
if the system should clean the input box for the user after each
character is written
the stack size for the input pad subtask
5.2.3
Terminating Handwriting Character Input
STATUS
CloseInputPad
(void)
CloseInputPad() closes the input pad that has been opened either by
OpenInputPad() or AdvOpenInputPad(). After it is closed, no more handwriting
recognition messages will be generated from the system to the application. The
original image covered by the input pad is restored by the system if the
areaClean
flag has been set to be 1(TRUE) before.
Example 5-4 Display characters receive from Input Pad
/* open an input pad at location (50, 50) that has 1 row of 4 boxes with the boxes
being 64x64 pixels each */
if (rv = OpenInputPad(50, 50, 1, 4, 64))
{
/* error */
return (rv);
}
while (running)
{
switch(IrptGetData((P_U32)&id, (P_U32*)&inData, (P_U32)&size))
{
/* Any icon pressed or handwritten character input */
Personal Portable System Manager
Programmer’s Manual
5-7
case IRPT_HWR:
/* Code here to handle the IRPT_HWR interrupt to receive the
recognized character candidates from the system */
DisplayKey((U16) (size >> 1), (P_U8)inData);
break;
/* Close keyboard icon selected */
case IRPT_ICON:
if (id == CloseIconId)
CloseInputPad();
break;
/* no more interrupt */
break;
} /* switch */
} /* while */
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.