Skip to content
Snippets Groups Projects
Commit 4a5489bd authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

- Ctrl+w should close windows on non-Mac and non-Windows archs
- Escape should close dialogs on all archs
parent 8bc430bb
No related branches found
No related tags found
No related merge requests found
...@@ -35,16 +35,15 @@ class Dialog_Window : public Fl_Double_Window { ...@@ -35,16 +35,15 @@ class Dialog_Window : public Fl_Double_Window {
case FL_SHORTCUT: case FL_SHORTCUT:
case FL_KEYBOARD: case FL_KEYBOARD:
#if defined(__APPLE__) #if defined(__APPLE__)
if(Fl::test_shortcut(FL_META+'w')){ if(Fl::test_shortcut(FL_META+'w') || Fl::test_shortcut(FL_Escape)){
do_callback();
return 1;
}
#elif defined(WIN32) #elif defined(WIN32)
if(Fl::test_shortcut(FL_ALT+FL_F+4)){ if(Fl::test_shortcut(FL_ALT+FL_F+4) || Fl::test_shortcut(FL_Escape)){
#else
if(Fl::test_shortcut(FL_CTRL+'w') || Fl::test_shortcut(FL_Escape)){
#endif
do_callback(); do_callback();
return 1; return 1;
} }
#endif
break; break;
} }
return Fl_Double_Window::handle(event); return Fl_Double_Window::handle(event);
...@@ -69,17 +68,15 @@ class Main_Window : public Fl_Window { ...@@ -69,17 +68,15 @@ class Main_Window : public Fl_Window {
case FL_KEYBOARD: case FL_KEYBOARD:
#if defined(__APPLE__) #if defined(__APPLE__)
if(Fl::test_shortcut(FL_META+'w')){ if(Fl::test_shortcut(FL_META+'w')){
if(fl_choice("Do you really want to quit?", "Cancel", "Quit", NULL))
do_callback();
return 1;
}
#elif defined(WIN32) #elif defined(WIN32)
if(Fl::test_shortcut(FL_ALT+FL_F+4)){ if(Fl::test_shortcut(FL_ALT+FL_F+4)){
#else
if(Fl::test_shortcut(FL_CTRL+'w')){
#endif
if(fl_choice("Do you really want to quit?", "Cancel", "Quit", NULL)) if(fl_choice("Do you really want to quit?", "Cancel", "Quit", NULL))
do_callback(); do_callback();
return 1; return 1;
} }
#endif
break; break;
} }
return Fl_Window::handle(event); return Fl_Window::handle(event);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment