On 9 Nov 2007, at 16:08, Kveto Ilencik wrote: > I do not want to allow the user to close their application with Alt > +F4 key combination. So I overloaded handle() method, and tried to > catch FL_KEYUP message, then to ask if Alt key and F4 key are > pressed together, if yes, then I returned with 1, otherwise with > Fl_Double_Window::handle(event) function call. > The problem is, that FL_KEYUP message seems to be not coming at all > to my window in this case, but the FLTK processes it so that the > application is closing automatically:-(. > I tried to catch FL_SHORTCUT message, but then I get only the Alt > key as an extra message, not the F4, which has been pressed as well. > > I would appreciate any help.
I assume this is on windows? (I don't think Alt+F4 is a close command on other platforms, at least not on this Mac...) Anyway, I'm pretty certain that key-combination is handled by the win32 window manager, so it is very likely that the key presses never really find their way to you app. I think maybe what you want to try (I don't know if it will work) is to override the window close callback as described in this note: http://www.fltk.org/articles.php?L378+I0+T+M10+P1+Qescape That might work for your case too. _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

