Kevin Cockrell wrote:
> Thanks matthiasm. I'm using the Fl_Text_Display to output some text (the only
> reason I'm using it instead of Fl_Multiline_Output is because I have a long
> string that need scroll bars). So I don't mind if the up and down keys don't
> work with it the text widgets. How do I got about modifying the text widgets
> so that they ignore the arrow keys? I can't seem to find any documentation
> relating to which widget grabs keyboard events first.
You can derive your own class from Fl_Text_Display,
and override handle() to detect arrow up/down events,
and return(0) instead of passing them down to the base
class. eg:
int YourTextDisplay::handle(int e) {
if ( you_detect_arrow_key_events ) { return(0); }
return(Fl_Text_Display::handle(e));
}
..so basically eclipsing the arrow key events from
the Fl_Text_Display widget. (This will disable their
ability to be scrolled with the arrow keys though)
Or, you might set up your openGL widget to handle
FOCUS events, so that it behaves like a normal widget
that can take focus for keyboard events. See the docs
on 'handling events', and/or look at some simple FLTK
widgets to see how they handle focus.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk