+ else if(key==Input::KEY_DELETE)
+ {
+ if(selection_active)
+ erase_selection(true);
+ else
+ {
+ unsigned end_pos = text.move_offset(edit_pos, 1);
+ erase(edit_pos, end_pos-edit_pos);
+ }
+ }
+ else if(key==Input::KEY_ENTER && multiline)
+ insert(edit_pos, "\n");
+ else if(key==Input::KEY_END)
+ {
+ unsigned row, col;
+ text.offset_to_coords(edit_pos, row, col);
+ set_edit_position(text.coords_to_offset(row, text.get_line_length(row)), mod==MOD_SHIFT);
+ }
+ else if(key==Input::KEY_HOME)
+ {
+ unsigned row, col;
+ text.offset_to_coords(edit_pos, row, col);
+ set_edit_position(text.coords_to_offset(row, 0), mod==MOD_SHIFT);
+ }
+ else if(key==Input::KEY_PGUP)
+ {
+ unsigned row, col;
+ text.offset_to_coords(edit_pos, row, col);
+ set_edit_position(text.coords_to_offset((row<visible_rows ? 0 : row-visible_rows), col), mod==MOD_SHIFT);
+ }
+ else if(key==Input::KEY_PGDN)
+ {
+ unsigned row, col;
+ text.offset_to_coords(edit_pos, row, col);
+ set_edit_position(text.coords_to_offset(row+visible_rows, col), mod==MOD_SHIFT);
+ }
+ else if(key==Input::KEY_LEFT && mod==MOD_SHIFT)
+ move_edit_position(NAV_LEFT, true);
+ else if(key==Input::KEY_RIGHT && mod==MOD_SHIFT)
+ move_edit_position(NAV_RIGHT, true);
+ else if(key==Input::KEY_UP && mod==MOD_SHIFT && multiline)
+ move_edit_position(NAV_UP, true);
+ else if(key==Input::KEY_DOWN && mod==MOD_SHIFT && multiline)
+ move_edit_position(NAV_DOWN, true);
+ else
+ return false;
+
+ return true;
+}
+
+bool Entry::character(wchar_t ch)
+{
+ if(got_key_press && ch>=' ' && ch!=0x7F)
+ {
+ if(selection_active)
+ erase_selection(false);
+ insert(edit_pos, StringCodec::encode<StringCodec::Utf8>(StringCodec::ustring(1, ch)));
+ return true;
+ }
+
+ return false;
+}
+
+void Entry::focus_in()
+{
+ cursor_blink = true;
+ Widget::focus_in();
+ check_cursor_blink();
+}
+
+void Entry::focus_out()
+{
+ Widget::focus_out();
+ got_key_press = false;
+ check_cursor_blink();
+}
+
+bool Entry::navigate(Navigation nav)
+{
+ if(nav==NAV_LEFT || nav==NAV_RIGHT || ((nav==NAV_DOWN || nav==NAV_UP) && multiline))
+ move_edit_position(nav, false);
+ else if(nav==NAV_ACCEPT && !signal_enter.empty())