mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-11-30 02:58:26 +08:00
improve pointer events
This commit is contained in:
parent
84a01fcc04
commit
a5d9453474
@ -2,6 +2,7 @@
|
||||
|
||||
2022/08/20
|
||||
* 支持gauge_pointer的默认指针的宽度跟随控件宽度改变而改变(感谢智明提供补丁)
|
||||
* 统一pointer_event的button的属性值 (感谢智明提供补丁)
|
||||
|
||||
2022/08/17
|
||||
* 完善conf\_xml,支持通过@text访问文本内容。
|
||||
|
@ -133,6 +133,7 @@ event_t* pointer_event_init(pointer_event_t* event, uint32_t type, void* target,
|
||||
event->e.size = sizeof(*event);
|
||||
event->x = x;
|
||||
event->y = y;
|
||||
event->button = 1;
|
||||
|
||||
return (event_t*)event;
|
||||
}
|
||||
|
@ -787,6 +787,9 @@ typedef struct _pointer_event_t {
|
||||
* @property {uint8_t} button
|
||||
* @annotation ["readable", "scriptable"]
|
||||
* button。
|
||||
* 在不同的平台,该属性会发生变化,
|
||||
* PC :左键为 1,中键为 2,右键为 3
|
||||
* 嵌入式:默认为 1
|
||||
*/
|
||||
xy_t button;
|
||||
/**
|
||||
|
@ -77,7 +77,7 @@ ret_t main_loop_post_pointer_event(main_loop_t* l, bool_t pressed, xy_t x, xy_t
|
||||
|
||||
event.x = x;
|
||||
event.y = y;
|
||||
event.button = 0;
|
||||
event.button = 1;
|
||||
event.e.time = time_now_ms();
|
||||
event.e.size = sizeof(pointer_event_t);
|
||||
|
||||
@ -165,6 +165,9 @@ static ret_t main_loop_dispatch_events(main_loop_simple_t* loop) {
|
||||
case EVT_POINTER_DOWN:
|
||||
case EVT_POINTER_MOVE:
|
||||
case EVT_POINTER_UP:
|
||||
if (r.pointer_event.button == 0) {
|
||||
r.pointer_event.button = 1;
|
||||
}
|
||||
window_manager_dispatch_input_event(widget, (event_t*)&(r.pointer_event));
|
||||
break;
|
||||
case EVT_WHEEL:
|
||||
|
Loading…
Reference in New Issue
Block a user