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.
This commit is contained in:
ManoloFLTK 2026-01-12 17:03:19 +01:00
parent 306de09987
commit 1c1b6c12f4

View File

@ -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;