Handle HOME and END keys in framebuffer

This commit is contained in:
Ashish Gupta 2017-10-08 21:55:04 +02:00 committed by Michael Drake
parent 6f33e48ca3
commit cbd23092d5
1 changed files with 16 additions and 0 deletions

View File

@ -388,6 +388,22 @@ text_input(fbtk_widget_t *widget, fbtk_callback_info *cbi)
}
break;
case NSFB_KEY_HOME:
if (widget->u.text.idx > 0) {
widget->u.text.idx = 0;
caret_moved = true;
}
break;
case NSFB_KEY_END:
if (widget->u.text.idx < widget->u.text.len) {
widget->u.text.idx = widget->u.text.len;
caret_moved = true;
}
break;
case NSFB_KEY_PAGEUP:
case NSFB_KEY_PAGEDOWN:
case NSFB_KEY_UP: