Product Application

©
Rev.1.1
2.7 Keys usage
In this example, the method for drawing and handling keys an buttons is presented. You will see on
the screen keyboard. After pressing keys the text will appear at the top of the screen. If displayed string
is too long it will be cleared.
Figure 7. Keyboard example
In the Figure 7 you can see effect of following code:
ft_void_t Keyboard()
{
{
if(FirstTimeThisDemo ==1)
{
TextFont = 29;
ButtonW = 30;
ButtonH = 30;
yBtnDst = 5;
CurrChar = '|';
CurrTag = 0;
PrevTag = 0;
Pendown = 1;
CurrTextIdx = 0;
if((tftConfig==CTP35) ||(tftConfig==CTP43))
{
Ft_Gpu_Hal_Wr8(phost,REG_CTOUCH_EXTENDED, CTOUCH_MODE_COMPATABILITY);//set
mode to compatability,
}
FirstTimeThisDemo=0;
}
{
/* Check the user input and then add the characters into array */
CurrTag = Ft_Gpu_Hal_Rd8(phost,REG_TOUCH_TAG);
Pendown = ((Ft_Gpu_Hal_Rd32(phost,REG_TOUCH_DIRECT_XY)>>31) & 0x01);
CurrChar = CurrTag;
if(CurrTag==249)
{
CurrTag=0;
}
if(0 == CurrTag)
{
CurrChar = '|';
}
/* check whether pendown has happened */
if(( 1 == Pendown) && (0 != PrevTag))
{