feat(sdk): 通用长按事件 (agent-191, 用户定案) — MEOW_EV_LONG_PRESS 坐标式事件+meow_ui_set_long_press_cb/ms(opt-in,默认500ms,移动>12px取消,长按后抬手抑制TAP/SWIPE); 按钮按住视觉阈值同源; files 长按从App层迁入 SDK
meow_ui.a 4335c33a→6de89c27; hello→72fb20da; files→b1c4f58f 宿主 widgets(含6条长按断言)/p1p2p3/ime_fix/test_fsx 全 PASS; 未改 meow_ui_events 结构(防 -Wmissing-field-initializers 破坏既有App)
This commit is contained in:
1 parent
60072a08f1
commit
e95552b949
14 files changed
+200
-35
No files matched your search
@@ -142,6 +142,7 @@ int meow_gfx_mfont_ready(void);
|
||||
#define MEOW_EV_SWIPE_PROGRESS 4 /* a=按下X(t_dx), b=当前X(t_cx);dx=b-a(>0=左缘向内划=返回手势) */
|
||||
#define MEOW_EV_TOUCH_DOWN 6 /* a=x, b=y:按下后首个有效坐标(拖动起点,M2.71-bug2/6) */
|
||||
#define MEOW_EV_TOUCH_MOVE 7 /* a=x, b=y:拖动过程坐标变化(坐标变才入队;跟手用) */
|
||||
#define MEOW_EV_LONG_PRESS 8 /* a=x, b=y:按下 ≥ 阈值未抬手(长按触发;其抬手不再产生 TAP/SWIPE) */
|
||||
|
||||
typedef struct meow_input_ev {
|
||||
uint8_t type;
|
||||
@@ -175,6 +176,15 @@ unsigned int meow_input_touch_hold_ms(void); /* 按下已持续毫秒
|
||||
* (把按下时刻回拨),便于测按住态;down=0 复位。设备运行时无调用方。 */
|
||||
void meow_input_touch_set(int down, int x, int y, unsigned hold_ms);
|
||||
|
||||
/* ---- 通用长按(§6.3,2026-08-31)----
|
||||
* 主循环/宿主调用:检测「按下 ≥ 阈值且位移 ≤ 容忍」的跨越;触发则入队 MEOW_EV_LONG_PRESS
|
||||
* 并返回 1(幂等:一次按压只触发一次)。供 meow_ui_run 每帧调用与宿主单测模拟时序。 */
|
||||
int meow_input_long_press_poll(void);
|
||||
/* 宿主单测/内部注入:模拟一次抬手(真实 touch_release;含长按后抑制 TAP/SWIPE)。设备运行时无调用方。 */
|
||||
void meow_input_touch_release(void);
|
||||
/* 宿主单测/内部注入:模拟按下后移动到 (x,y)(保原点、更新当前坐标;位移超长按容忍即取消)。设备运行时无调用方。 */
|
||||
void meow_input_touch_move(int x, int y);
|
||||
|
||||
/* ---- 控件层实时刷新(meow_ui_widget.c)----
|
||||
* 每帧由 meow_ui_run 调用(主线程):实时触摸按下/释放/按住达阈值时,重绘命中的按钮区
|
||||
* 并局部上屏,让按压/按住/释放视觉即时反映,无需 app 在 on_tick/on_tap 重绘(agent-119)。
|
||||
|
||||
Reference in new issue
Block a user