diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp index 41d4da70f0bdca40e5bc95f3a1d6c9eedac0d724..8dcaa2a452d097977f43df5161946805dd780cca 100644 --- a/Fltk/GUI.cpp +++ b/Fltk/GUI.cpp @@ -1,4 +1,4 @@ -// $Id: GUI.cpp,v 1.155 2002-02-22 16:44:09 geuzaine Exp $ +// $Id: GUI.cpp,v 1.156 2002-02-22 17:40:58 geuzaine Exp $ // To make the interface as visually consistent as possible, please: // - use the IW, BB, BH, BW and WB values @@ -506,7 +506,19 @@ int GUI::global_shortcuts(int event){ show = !show; return 1; } - else if(Fl::test_shortcut(FL_Left)){ + else if(arrow_shortcuts()){ + return 1; + } + + return 0; +} + +// Test the arrow shortcuts (this is not in the global_shortcuts) +// since it is used elsewhere (where we want to override widget +// navigation: necessary since FLTK>=1.1) + +int GUI::arrow_shortcuts(){ + if(Fl::test_shortcut(FL_Left)){ ManualPlay(1,-1); return 1; } @@ -522,8 +534,6 @@ int GUI::global_shortcuts(int event){ ManualPlay(0,1); return 1; } - - return 0; } diff --git a/Fltk/GUI.h b/Fltk/GUI.h index 3360c63f2a9a840e7fe56908977f0c5d157e8621..9da8e84eb54fed73f831088cce6093e2595e5520 100644 --- a/Fltk/GUI.h +++ b/Fltk/GUI.h @@ -234,6 +234,7 @@ public: void set_title(char *str); void add_handler(); int global_shortcuts(int event); + int arrow_shortcuts(); void reset_visibility(); int selection, try_selection, quit_selection, end_selection; diff --git a/Fltk/Opengl_Window.cpp b/Fltk/Opengl_Window.cpp index 83ea8aca711ebc00d9e5efea7533f20baec18465..f259b9e82896093344c9faf34555d1479a8a408a 100644 --- a/Fltk/Opengl_Window.cpp +++ b/Fltk/Opengl_Window.cpp @@ -1,4 +1,4 @@ -// $Id: Opengl_Window.cpp,v 1.19 2001-11-19 14:24:02 geuzaine Exp $ +// $Id: Opengl_Window.cpp,v 1.20 2002-02-22 17:40:58 geuzaine Exp $ #include "Gmsh.h" #include "Numeric.h" @@ -114,6 +114,23 @@ int Opengl_Window::handle(int event) { switch (event) { + case FL_ENTER : + take_focus(); //force keyboard focus on the Opengl_Window + return 1; + + case FL_LEAVE : + case FL_FOCUS : + case FL_UNFOCUS : + return 1; + + case FL_SHORTCUT : + case FL_KEYBOARD : + // this overrides the default navigation + if(WID->arrow_shortcuts()){ + return 1; + } + return Fl_Gl_Window::handle(event); + case FL_PUSH: FirstClick = 1; ibut = Fl::event_button();