函数原型:
void begin(m5gfx::LGFX_Device* gfx);
功能说明:
传入参数:
返回值:
函数原型:
void update(std::uint32_t msec);
功能说明:
传入参数:
返回值:
函数原型:
bool isEnabled(void);
功能说明:
传入参数:
返回值:
函数原型:
void end(void);
功能说明:
传入参数:
返回值:
函数原型:
std::uint8_t getCount(void);
功能说明:
传入参数:
返回值:
函数原型:
const touch_detail_t& getDetail(std::size_t index = 0);
功能说明:
传入参数:
返回值:
函数原型:
inline const m5gfx::touch_point_t& getTouchPointRaw(std::size_t index = 0) const { return _touch_raw[index < _detail_count ? index : 0]; }
功能说明:
传入参数:
返回值:
函数原型:
void setHoldThresh(std::uint16_t msec) { _msecHold = msec; }
功能说明:
传入参数:
返回值:
函数原型:
void setFlickThresh(std::uint16_t distance) { _flickThresh = distance; }
功能说明:
传入参数:
返回值:
函数原型:
struct touch_detail_t : public m5gfx::touch_point_t
{
union
{ /// Previous point
point_t prev;
struct
{
std::int16_t prev_x;
std::int16_t prev_y;
};
};
union
{ /// Flick start point
point_t base;
struct
{
std::int16_t base_x;
std::int16_t base_y;
};
};
std::uint32_t base_msec;
touch_state_t state = touch_state_t::none;
std::uint8_t click_count = 0;
inline int deltaX(void) const { return x - prev_x; }
inline int deltaY(void) const { return y - prev_y; }
inline int distanceX(void) const { return x - base_x; }
inline int distanceY(void) const { return y - base_y; }
inline bool isPressed(void) const { return state & touch_state_t::mask_touch; };
inline bool wasPressed(void) const { return state == touch_state_t::touch_begin; };
inline bool wasClicked(void) const { return state == touch_state_t::touch_end; };
inline bool isReleased(void) const { return !(state & touch_state_t::mask_touch); };
inline bool wasReleased(void) const { return (state & (touch_state_t::mask_touch | touch_state_t::mask_change)) == touch_state_t::mask_change; };
inline bool isHolding(void) const { return (state & (touch_state_t::mask_touch | touch_state_t::mask_holding)) == (touch_state_t::mask_touch | touch_state_t::mask_holding); }
inline bool wasHold(void) const { return state == touch_state_t::hold_begin; }
inline bool wasFlickStart(void) const { return state == touch_state_t::flick_begin; }
inline bool isFlicking(void) const { return (state & touch_state_t::drag) == touch_state_t::flick; }
inline bool wasFlicked(void) const { return state == touch_state_t::flick_end; }
inline bool wasDragStart(void) const { return state == touch_state_t::drag_begin; }
inline bool isDragging(void) const { return (state & touch_state_t::drag) == touch_state_t::drag; }
inline bool wasDragged(void) const { return state == touch_state_t::drag_end; }
inline std::uint8_t getClickCount(void) const { return click_count; }
};
函数原型:
inline int deltaX(void) const { return x - prev_x; }
功能说明:
传入参数:
返回值:
函数原型:
inline int deltaY(void) const { return y - prev_y; }
功能说明:
传入参数:
返回值:
函数原型:
inline int distanceX(void) const { return x - base_x; }
功能说明:
传入参数:
返回值:
函数原型:
inline int distanceY(void) const { return y - base_y; }
功能说明:
传入参数:
返回值:
函数原型:
inline bool isPressed(void) const { return state & touch_state_t::mask_touch; };
功能说明:
传入参数:
返回值:
函数原型:
inline bool wasPressed(void) const { return state == touch_state_t::touch_begin; };
功能说明:
传入参数:
返回值:
函数原型:
inline bool wasClicked(void) const { return state == touch_state_t::touch_end; };
功能说明:
传入参数:
返回值:
函数原型:
inline bool isReleased(void) const { return !(state & touch_state_t::mask_touch); };
功能说明:
传入参数:
返回值:
函数原型:
inline bool wasReleased(void) const { return (state & (touch_state_t::mask_touch | touch_state_t::mask_change)) == touch_state_t::mask_change; };
功能说明:
传入参数:
返回值:
函数原型:
inline bool isHolding(void) const { return (state & (touch_state_t::mask_touch | touch_state_t::mask_holding)) == (touch_state_t::mask_touch | touch_state_t::mask_holding); }
功能说明:
传入参数:
返回值:
函数原型:
inline bool wasHold(void) const { return state == touch_state_t::hold_begin; }
功能说明:
传入参数:
返回值:
函数原型:
inline bool wasFlickStart(void) const { return state == touch_state_t::flick_begin; }
功能说明:
传入参数:
返回值:
函数原型:
inline bool isFlicking(void) const { return (state & touch_state_t::drag) == touch_state_t::flick; }
功能说明:
传入参数:
返回值:
函数原型:
inline bool wasFlicked(void) const { return state == touch_state_t::flick_end; }
功能说明:
传入参数:
返回值:
函数原型:
inline bool wasDragStart(void) const { return state == touch_state_t::drag_begin; }
功能说明:
传入参数:
返回值:
函数原型:
inline bool isDragging(void) const { return (state & touch_state_t::drag) == touch_state_t::drag; }
传入参数:
返回值:
函数原型:
inline bool wasDragged(void) const { return state == touch_state_t::drag_end; }
功能说明:
传入参数:
返回值:
函数原型:
inline std::uint8_t getClickCount(void) const { return click_count; }
功能说明:
传入参数:
返回值: