Touchgfx的事件类型有:点击事件、拖拽事件、手势事件和定时事件、外部按键事件、屏幕转换挂起事件
当引擎检测到这些事件的时候,调用事件处理函数传递给应用
#ifndef TOUCHGFX_EVENT_HPP
#define TOUCHGFX_EVENT_HPP
namespace touchgfx
{
/* 事件类 */
class Event
{
public:
/* 事件类型 */
enum EventType
{
EVENT_CLICK, //点击
EVENT_DRAG, //拖拽
EVENT_GESTURE //手势
};
/* 构造函数 */
Event()
{
}
/* 析构函数 */
virtual ~Event()
{
}
/* 获取事件类型 */
virtual EventType getEventType() const = 0;
};
}
#endif
点击事件
#ifndef TOUCHGFX_CLICKEVENT_HPP
#define TOUCHGFX_CLICKEVENT_HPP
#include <touchgfx/Event.hpp>
#include <touchgfx/hal/Types.hpp>
namespace touchgfx
{
/* 点击事件 */
class ClickEvent : public Event
{
public:
/* 点击事件类型 */
enum ClickEventTy