mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-12-03 04:27:44 +08:00
add handling for up/down key
This commit is contained in:
parent
21caa7321c
commit
9bbd1696fb
@ -101,6 +101,14 @@ static ret_t list_view_on_event(widget_t* widget, event_t* e) {
|
||||
} else if (evt->key == TK_KEY_PAGEUP) {
|
||||
scroll_view_scroll_delta_to(list_view->scroll_view, 0, -widget->h, TK_ANIMATING_TIME);
|
||||
ret = RET_STOP;
|
||||
} else if (evt->key == TK_KEY_UP) {
|
||||
uint32_t item_height = tk_max(list_view->item_height, 20);
|
||||
scroll_view_scroll_delta_to(list_view->scroll_view, 0, -item_height, TK_ANIMATING_TIME);
|
||||
ret = RET_STOP;
|
||||
} else if (evt->key == TK_KEY_DOWN) {
|
||||
uint32_t item_height = tk_max(list_view->item_height, 20);
|
||||
scroll_view_scroll_delta_to(list_view->scroll_view, 0, item_height, TK_ANIMATING_TIME);
|
||||
ret = RET_STOP;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user