⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gui_touch.c

📁 uCGUI
💻 C
字号:
/*************************************************************************************************************
                                                   uC/GUI
                                               嵌入式通用图形软件
File        : GUITOUCH.C
Purpose     : Touch screen manager
This module handles the touch screen. It is configured in the file
GUITouch.conf.h (Should be located in the Config\ directory).
*************************************************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "LCD_Private.H"      /* private modul definitions & config */
#include "GUI_Protected.h"

/*************************************************************************************************************
       static data
*************************************************************************************************************/
static GUI_HID_STATE _State;

/*************************************************************************************************************
              GUI_TOUCH_GetState
*************************************************************************************************************/
int GUI_TOUCH_GetState(GUI_HID_STATE *pState) 
{
  *pState = _State;
  return (_State.Pressed != 0) ? 1 : 0;
}

void GUI_TOUCH_StoreState(int x, int y) 
{
  #if GUI_SUPPORT_TOUCH
    static int xPrev=-1, yPrev=-1;
    _State.x       = xPrev;
    _State.y       = yPrev;
    _State.Pressed = ((x==-1) | (xPrev==-1))  ? 0 : 1;
    if ((xPrev != x) || (yPrev != y)) {
      GUI_HID_StoreState(&_State);
    }
    xPrev = x;
    yPrev = y;
  #else
    GUI_USE_PARA(x);
    GUI_USE_PARA(y);
  #endif
}




⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -