summaryrefslogtreecommitdiff
path: root/src/Fl_cocoa.mm
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2026-01-12 17:03:19 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2026-01-12 17:03:19 +0100
commit1c1b6c12f48e5a4027833d4b08c2a645b91d4c12 (patch)
tree528d66ee598798432aa348529621cd21a9706cac /src/Fl_cocoa.mm
parent306de0998715ef8043c4e26cbb1dc73f784f815b (diff)
Restore emojis support under recent macOS versions - cont'd (#1360)
Detect Ctrl+Command+Space to open character palette only if not used before as shortcut.
Diffstat (limited to 'src/Fl_cocoa.mm')
-rw-r--r--src/Fl_cocoa.mm13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 282bc4ecc..5cdcb9087 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -2577,10 +2577,8 @@ static FLTextInputContext* fltextinputcontext_instance = nil;
}
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"] ) ) {
+ // detect Function+e to open character palette
+ if ((mods & NSEventModifierFlagFunction) && [pure isEqualToString:@"e"] ) {
[NSApp orderFrontCharacterPalette:self];
return YES;
}
@@ -2596,6 +2594,13 @@ static FLTextInputContext* fltextinputcontext_instance = nil;
[FLView prepareEtext:s];
Fl::compose_state = 0;
handled = Fl::handle(FL_KEYBOARD, w);
+ if (!handled) {
+ // detect Ctrl+Command+Space to open character palette, if not used before as shortcut
+ if ( (mods & NSEventModifierFlagControl) && (mods & NSEventModifierFlagCommand) &&
+ !(mods & (NSEventModifierFlagShift|NSEventModifierFlagOption)) && [pure isEqualToString:@" "] ) {
+ [NSApp orderFrontCharacterPalette:self];
+ }
+ }
}
else {
in_key_event = YES;