> On 05/11/12 10:11, Greg Ercolano wrote: > > On 05/11/12 06:32, Matthias Melcher wrote: > > If there's bugs/shortcomings with Fl_Text_Display's > > caret + keynav, we should probably fix it, so that it > > can be a fully functional replacement for Fl_Multiline_Output. > > > > I did notice, as David did, that the caret would sometimes > > not appear. I found if the window opened when my mouse wasn't in it, > > the caret wouldn't appear. And moving the mouse INTO the window > > didn't make it appear. > > I've opened STR#2844 for this on David's behalf for this > to be investigated. > > The Fl_Text_XXX widgets seem pretty complex under the hood, > so I'm leaving it open for someone to investigate who's familiar > with it.
Before I discuss caret behavior. I have a further related issue (it's all bound up in the same widget). I need to trap all keystrokes so #include <FL/Fl.H> #include <FL/Fl_Double_Window.H> #include <FL/Fl_Text_Display.H> class EventWindow : public Fl_Double_Window { private: // Fl_Text_Buffer* buff; // Fl_Text_Display* disp; int handle_keyup(int event, int key, int state); int handle_keydn(int event, int key, int state); public: EventWindow(); int handle(int e); }; EventWindow::EventWindow() : Fl_Double_Window(640,480,"Display") { // buff = new Fl_Text_Buffer(); // disp = new Fl_Text_Display(20,20,640-40,480-40); // disp->buffer(buff); add(*disp); show(); // buff->text("line 0\nline 1\nline 2\nline 3\nline 4\nline 5\n"); } int EventWindow::handle(int event) { switch (event) { case FL_KEYUP: return handle_keyup(event,Fl::event_key(),Fl::event_state()); case FL_KEYBOARD: return handle_keydn(event,Fl::event_key(),Fl::event_state()); default: return Fl_Double_Window::handle(event); }; } int EventWindow::handle_keydn(int pEvent, int pKey,int pState) { printf("KeyDN Key = %d State = %d\n",pKey,pState);fflush(stdout); return 1; } int EventWindow::handle_keyup(int pEvent, int pKey,int pState) { printf("KeyUP Key = %d State = %d\n",pKey,pState);fflush(stdout); return 1; } int main() { EventWindow* win = new EventWindow(); win->show(); return Fl::run(); } Running the program as is You get a keyup for all keys. Removing all comments and NOW (KP_arrows, arrows, KP_home,KP_end,home,end,others??) generate a KEYUP BUT NOT a KEYDOWN(KEYBOARD). I don't understand ? _______________________________________________ fltk-dev mailing list fltk-dev@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-dev