summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2026-01-12 16:34:30 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2026-01-12 16:34:30 +0100
commit306de0998715ef8043c4e26cbb1dc73f784f815b (patch)
tree9fa021386420eb00ef216252848543c54bec6b3c /src
parent69669256d44b0686db5e4dfe6cdacd56fdcc8608 (diff)
Restore emojis support under recent macOS versions - cont'd (#1360)
This makes FLTK open the character palette when typing Ctrl+Command+Space or Function+e
Diffstat (limited to 'src')
-rw-r--r--src/Fl_cocoa.mm12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 14f9a557b..282bc4ecc 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -1,7 +1,7 @@
//
// macOS-Cocoa specific code for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2025 by Bill Spitzak and others.
+// Copyright 1998-2026 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -2575,10 +2575,18 @@ static FLTextInputContext* fltextinputcontext_instance = nil;
if ([[self window] firstResponder] != self) {
return NO;
}
+ NSUInteger mods = [theEvent modifierFlags];
+ NSString *pure = [theEvent charactersIgnoringModifiers];
+ // detect Ctrl+Command+Space or Function+e to open character palette
+ if ( (( (mods & NSEventModifierFlagControl) && (mods & NSEventModifierFlagCommand) &&
+ !(mods & (NSEventModifierFlagShift|NSEventModifierFlagOption)) && [pure isEqualToString:@" "] ) ) ||
+ ( (mods & NSEventModifierFlagFunction) && [pure isEqualToString:@"e"] ) ) {
+ [NSApp orderFrontCharacterPalette:self];
+ return YES;
+ }
fl_lock_function();
cocoaKeyboardHandler(theEvent);
BOOL handled;
- NSUInteger mods = [theEvent modifierFlags];
Fl_Window *w = [(FLWindow*)[theEvent window] getFl_Window];
if ( (mods & NSEventModifierFlagControl) || (mods & NSEventModifierFlagCommand) ) {
NSString *s = [theEvent characters];