From 0bd9018d649616ec81430bc5c3a2ad2b4f46575a Mon Sep 17 00:00:00 2001 From: Bill Spitzak Date: Fri, 18 Feb 2000 07:11:09 +0000 Subject: Fixed the Ctrl+P shortcut problem reported by dalitz@infotech.de The previous keystroke is not confused with a navigation control key when the window focus changes. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1003 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/Fl.cxx') diff --git a/src/Fl.cxx b/src/Fl.cxx index dd630f286..3d22c29e7 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -1,6 +1,6 @@ #include // -// "$Id: Fl.cxx,v 1.24.2.15 2000/02/15 08:31:45 bill Exp $" +// "$Id: Fl.cxx,v 1.24.2.16 2000/02/18 07:11:08 bill Exp $" // // Main event handling code for the Fast Light Tool Kit (FLTK). // @@ -352,6 +352,8 @@ void fl_fix_focus() { if (Fl::grab()) return; // don't do anything while grab is on. + Fl::e_keysym = 0; // make sure it is not confused with navigation key + // set focus based on Fl::modal() and fl_xfocus Fl_Widget* w = fl_xfocus; if (w) { @@ -480,12 +482,11 @@ int Fl::handle(int event, Fl_Window* window) window = 0; case FL_FOCUS: fl_xfocus = window; - e_keysym = 0; // make sure it is not confused with navigation key fl_fix_focus(); return 1; case FL_KEYBOARD: - fl_xfocus = window; // this should already be set, but just in case. + fl_xfocus = window; // this should not happen! But maybe it does: // Try it as keystroke, sending it to focus and all parents: for (w = grab() ? grab() : focus(); w; w = w->parent()) @@ -705,5 +706,5 @@ int fl_old_shortcut(const char* s) { } // -// End of "$Id: Fl.cxx,v 1.24.2.15 2000/02/15 08:31:45 bill Exp $". +// End of "$Id: Fl.cxx,v 1.24.2.16 2000/02/18 07:11:08 bill Exp $". // -- cgit v1.2.3