Greg Ercolano wrote:
> Domingo Alvarez Duarte wrote:
>> I've updated my code to latest svn and noticed that the new key navigation
>> with the TAB key first select all on the first press and need a second
>> press to move to another widget.
>>
>> Why we need two key presses ?
>
> I agree the behavior is bad, as it's inconsistent with the behavior
> of Shift-Tab, and would be happy to try to solve it while my nose
> is in Fl_Input.
I see it; this patch (below) removes the offending code.
The removed code seems wrong; the way I read it:
"if someone hits tab while there's a selection, deselect the selection,
and move to the end of the line, and consider the event handled"..
makes no sense to me.
When there's a selection, 'Tab' should either change focus (Fl_Input)
or erase the selection and replace it with a tab (Fl_Multiline_Input).
Applying the patch makes it work that way, and prevents the 'double-tap' tab
in both directions (Tab and Shift-Tab)
I'm guessing it's some kind of left over from the transition
to tab focus, to prevent 'tabbing over' a widget and having it
blot out the current selection. Newer changes elsewhere in the
code seemed to remedy this already, making this code obsolete.
Index: src/Fl_Input.cxx
===================================================================
--- src/Fl_Input.cxx (revision 8047)
+++ src/Fl_Input.cxx (working copy)
@@ -526,18 +526,9 @@
break;
case FL_KEYBOARD:
- if (Fl::event_key() == FL_Tab && mark() != position()) {
- // Set the current cursor position to the end of the selection...
- if (mark() > position())
- position(mark());
- else
- position(position());
- return (1);
- } else {
- if (active_r() && window() && this == Fl::belowmouse())
- window()->cursor(FL_CURSOR_NONE);
- return handle_key();
- }
+ if (active_r() && window() && this == Fl::belowmouse())
+ window()->cursor(FL_CURSOR_NONE);
+ return handle_key();
//NOTREACHED
case FL_PUSH:
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev