icfans

横屏应用下TP shortcut无法应用问题

0
阅读(2189)

[DESCRIPTION]
横屏应用下,TP shortcut没有响应
[SOLUTION]半导体
此问题原因是在横屏情况下屏幕有旋转,造成左边映射也同步翻转过来,导致坐标响应错误。
修正方法就是在横屏情况下部队shortcut部分坐标做映射,如下:
void gdi_rotate_map_absolute_hw_to_lcd(S32 *x, S32 *y)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
GDI_ENTER_CRITICAL_SECTION(gdi_rotate_map_absolute_hw_to_lcd)
S32 tx, ty;
#ifdef __MMI_TOUCH_PANEL_SHORTCUT__
if(*y > TOUCH_PANEL_COORD_Y_END)
{
NULL;
}
else
{
#endif
switch (GDI_LCD->rotate_value)
{
case GDI_LCD_LAYER_ROTATE_0:
default:
break;
case GDI_LCD_LAYER_ROTATE_90:
tx = GDI_LCD->act_height - *y - 1;
ty = *x;
*x = tx;
*y = ty;
break;
case GDI_LCD_LAYER_ROTATE_180:
tx = GDI_LCD->act_width - *x - 1;
ty = GDI_LCD->act_height - *y - 1;
*x = tx;
*y = ty;
break;
case GDI_LCD_LAYER_ROTATE_270:
tx = *y;
ty = GDI_LCD->act_width - *x - 1;
*x = tx;
*y = ty;
break;
case GDI_LCD_LAYER_ROTATE_0_MIRROR:
tx = GDI_LCD->act_width - *x - 1;
*x = tx;
break;
case GDI_LCD_LAYER_ROTATE_90_MIRROR:
tx = *y;
ty = *x;
*x = tx;
*y = ty;
break;
case GDI_LCD_LAYER_ROTATE_180_MIRROR:
ty = GDI_LCD->act_height - *y - 1;
*y = ty;
break;
case GDI_LCD_LAYER_ROTATE_270_MIRROR:
tx = GDI_LCD->act_height - *y - 1;
ty = GDI_LCD->act_width - *x - 1;
*x = tx;
*y = ty;
break;
}
#ifdef __MMI_TOUCH_PANEL_SHORTCUT__
}
#endif
GDI_EXIT_CRITICAL_SECTION(gdi_rotate_map_absolute_hw_to_lcd)
}

半导体社区