From f582e06224f178a73b25bd241933c4f50ff36279 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Tue, 26 Jul 2022 19:01:41 +0200 Subject: Fl_Sys_Menu_Bar: allow use of escape and tab as menu shortcuts. --- src/Fl_MacOS_Sys_Menu_Bar.mm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Fl_MacOS_Sys_Menu_Bar.mm b/src/Fl_MacOS_Sys_Menu_Bar.mm index 57833511e..314e6e44e 100644 --- a/src/Fl_MacOS_Sys_Menu_Bar.mm +++ b/src/Fl_MacOS_Sys_Menu_Bar.mm @@ -177,7 +177,11 @@ const char *Fl_Mac_App_Menu::quit = "Quit %@"; if ( (key >= (FL_F+1)) && (key <= FL_F_Last) ) { // Handle function keys int fkey_num = (key - FL_F); // 1,2.. mac_key = NSF1FunctionKey + fkey_num - 1; - } + } else if (key == FL_Escape) { + mac_key = 27; + } else if (key == FL_Tab) { + mac_key = 9; + } [self setKeyEquivalent:[NSString stringWithCharacters:&mac_key length:1]]; [self setKeyEquivalentModifierMask:mod]; } -- cgit v1.2.3