summaryrefslogtreecommitdiff
path: root/framebuffer
diff options
context:
space:
mode:
Diffstat (limited to 'framebuffer')
-rw-r--r--framebuffer/fbtk/text.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/framebuffer/fbtk/text.c b/framebuffer/fbtk/text.c
index 69e82153d..879d88888 100644
--- a/framebuffer/fbtk/text.c
+++ b/framebuffer/fbtk/text.c
@@ -413,9 +413,9 @@ text_input(fbtk_widget_t *widget, fbtk_callback_info *cbi)
return 0;
}
-/** Routine called when text events occour in writeable widget.
+/** Routine called when click events occour in writeable widget.
*
- * @param widget The widget reciving input events.
+ * @param widget The widget reciving click events.
* @param cbi The callback parameters.
* @return The callback result.
*/
@@ -447,6 +447,20 @@ text_input_click(fbtk_widget_t *widget, fbtk_callback_info *cbi)
return 0;
}
+/** Routine called when "stripped of focus" event occours for writeable widget.
+ *
+ * @param widget The widget reciving "stripped of focus" event.
+ * @param cbi The callback parameters.
+ * @return The callback result.
+ */
+static int
+text_input_strip_focus(fbtk_widget_t *widget, fbtk_callback_info *cbi)
+{
+ fbtk_set_caret(widget, false, 0, 0, 0, NULL);
+
+ return 0;
+}
+
/* exported function documented in fbtk.h */
void
fbtk_writable_text(fbtk_widget_t *widget, fbtk_enter_t enter, void *pw)
@@ -546,6 +560,7 @@ fbtk_create_writable_text(fbtk_widget_t *parent,
fbtk_set_handler(neww, FBTK_CBT_REDRAW, fb_redraw_text, NULL);
fbtk_set_handler(neww, FBTK_CBT_CLICK, text_input_click, pw);
+ fbtk_set_handler(neww, FBTK_CBT_STRIP_FOCUS, text_input_strip_focus, NULL);
fbtk_set_handler(neww, FBTK_CBT_INPUT, text_input, neww);
return neww;