Пример #1
0
//----读取触摸点坐标-----------------------------------------------------------
//功能: 读取stmpe811采集到的触摸点坐标,如果有多点,则平均之
//参数: touch_data,采集到的坐标
//返回: 1=触摸笔按下,0=触摸笔提起,
//-----------------------------------------------------------------------------
static ufast_t read_touch_data(struct SingleTouchMsg *touch_data)
{
     static s32 x=0,y=0,z=0;

    touch_data->display = NULL;
    if(ts_is_down())
    {

        x =ts_get_x_data_raw();
        y =ts_get_y_data_raw();
        z =1;
        ts_translate_data(&x,&y);
        touch_data->x =x;
        touch_data->y =y;
        touch_data->z = z;

        return 1;
    }
    else
    {
        touch_data->z = 0;
        return 0;
    }

}
Пример #2
0
//----读取触摸点坐标-----------------------------------------------------------
//功能: 读取stmpe811采集到的触摸点坐标,如果有多点,则平均之
//参数: touch_data,采集到的坐标
//返回: 1=触摸笔按下,0=触摸笔提起,
//-----------------------------------------------------------------------------
static ufast_t read_touch_data(struct tagSingleTouchMsg *touch_data)
{
	 static s32 x=0,y=0,z=0;

	if(ts_is_down())
	{
		ts_get_data_raw(&x,&y);
		z =1;
		ts_translate_data(&x,&y);
		touch_data->x =x;
		touch_data->y =y;
        touch_data->z = z;

        return 1;

	}
	MouseInput(x,y,0);
	return 0;

}