improve event_from_name

This commit is contained in:
lixianjing 2024-01-23 09:30:36 +08:00
parent 51a96caaae
commit 9ae4679c75
2 changed files with 22 additions and 0 deletions

View File

@ -1,5 +1,8 @@
# 最新动态
2024/01/23
* 完善 event\_from\_name感谢志鹏提供补丁
2024/01/21
* add tk\_pointer\_to\_long/tk\_pointer\_from\_long/tk\_bits\_to\_bytes

View File

@ -239,16 +239,27 @@ int32_t event_from_name(const char* name) {
if (tk_str_eq(name, "focus")) {
return EVT_FOCUS;
}
break;
}
case 'b': {
if (tk_str_eq(name, "blur")) {
return EVT_BLUR;
}
break;
}
case 'd': {
if (tk_str_eq(name, "data")) {
return EVT_DATA;
} else if (tk_str_eq(name, "drag_start")) {
return EVT_DRAG_START;
} else if (tk_str_eq(name, "drag")) {
return EVT_DRAG;
} else if (tk_str_eq(name, "drag_end")) {
return EVT_DRAG_END;
} else if (tk_str_eq(name, "double_click")) {
return EVT_DOUBLE_CLICK;
}
break;
}
case 'g': {
if (tk_str_eq(name, "global_key_up")) {
@ -349,11 +360,19 @@ int32_t event_from_name(const char* name) {
case 'm': {
if (tk_str_eq(name, "model_change")) {
return EVT_MODEL_CHANGE;
} else if (tk_str_eq(name, "move")) {
return EVT_MOVE;
} else if (tk_str_eq(name, "move_resize")) {
return EVT_MOVE_RESIZE;
}
break;
}
case 'r': {
if (tk_str_eq(name, "resize")) {
return EVT_RESIZE;
}
break;
}
default:
break;
}