Example #1
0
/**************************************************************//*!
*
* Manage touch screen events (part of main poll call)
*
******************************************************************/
static void D4D_ManageTouchScreenEvents(void)
{
  D4D_COOR x,y;
  D4D_BOOL tmp_res;

  if(D4D_TCH_GetCalibrationStatus() == 0)
  {
    D4D_CalibrateTouchScreen();
    return;
  }

  if(d4d_TouchScreen_Status & D4D_TCHSCR_STATUS_NEWTOUCH)
    return;

  tmp_res = D4D_GetTouchScreen(&x, &y);

  if(((d4d_TouchScreen_Status & D4D_TCHSCR_STATUS_TOUCHED) ^ (tmp_res)))
  {
    if(tmp_res)
      d4d_TouchScreen_Status |= D4D_TCHSCR_STATUS_TOUCHED;
    else
      d4d_TouchScreen_Status &= ~D4D_TCHSCR_STATUS_TOUCHED;

    if(tmp_res)
      d4d_TouchScreen_Status |= D4D_TCHSCR_STATUS_NEWTOUCH;
  }

  if(tmp_res)
  {
    d4d_TouchScreenCoor.x = (D4D_COOR)x;
    d4d_TouchScreenCoor.y = (D4D_COOR)y;

    #ifdef D4D_INPUT_EVENT_CALLBACK
      D4D_INPUT_EVENT_CALLBACK();
    #endif
  }

}
Example #2
0
/**
 * Show touch screen calibration screen store settings afterwards
 */
void calibrateTouchScreen() {
    D4D_CalibrateTouchScreen();
    eGuiSettings.storeTouchCalib();
}