From 0f6d481f88e63353f7959a8605b3e3c024654c3c Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Mon, 18 Mar 2013 17:20:09 -0700 Subject: [PATCH] FL/Fl_Sometimes_Input: Run callback on defocus (including Tab key press). --- FL/Fl_Sometimes_Input.H | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/FL/Fl_Sometimes_Input.H b/FL/Fl_Sometimes_Input.H index 6e26c01..75ad223 100644 --- a/FL/Fl_Sometimes_Input.H +++ b/FL/Fl_Sometimes_Input.H @@ -75,13 +75,21 @@ public: { case FL_KEYDOWN: { - if ( r && Fl::event_key() == FL_Enter ) + if ( ( Fl::event_key() == FL_Enter || + Fl::event_key() == FL_Tab ) ) + { Fl::focus( NULL ); + return 1; + } + else + return r; } case FL_FOCUS: - case FL_UNFOCUS: redraw(); return 1; + case FL_UNFOCUS: + do_callback(); + return 1; case FL_PUSH: take_focus(); redraw();