| 1 |
/**************************************************************************/ |
| 2 |
/* display_server_macos_base.mm */ |
| 3 |
/**************************************************************************/ |
| 4 |
/* This file is part of: */ |
| 5 |
/* GODOT ENGINE */ |
| 6 |
/* https://godotengine.org */ |
| 7 |
/**************************************************************************/ |
| 8 |
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ |
| 9 |
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ |
| 10 |
/* */ |
| 11 |
/* Permission is hereby granted, free of charge, to any person obtaining */ |
| 12 |
/* a copy of this software and associated documentation files (the */ |
| 13 |
/* "Software"), to deal in the Software without restriction, including */ |
| 14 |
/* without limitation the rights to use, copy, modify, merge, publish, */ |
| 15 |
/* distribute, sublicense, and/or sell copies of the Software, and to */ |
| 16 |
/* permit persons to whom the Software is furnished to do so, subject to */ |
| 17 |
/* the following conditions: */ |
| 18 |
/* */ |
| 19 |
/* The above copyright notice and this permission notice shall be */ |
| 20 |
/* included in all copies or substantial portions of the Software. */ |
| 21 |
/* */ |
| 22 |
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ |
| 23 |
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ |
| 24 |
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ |
| 25 |
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ |
| 26 |
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ |
| 27 |
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ |
| 28 |
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ |
| 29 |
/**************************************************************************/ |
| 30 |
|
| 31 |
#import "display_server_macos_base.h" |
| 32 |
#import "key_mapping_macos.h" |
| 33 |
#import "tts_macos.h" |
| 34 |
|
| 35 |
#include "core/config/project_settings.h" |
| 36 |
#include "drivers/png/png_driver_common.h" |
| 37 |
|
| 38 |
#import <Carbon/Carbon.h> |
| 39 |
|
| 40 |
void DisplayServerMacOSBase::clipboard_set(const String &p_text) { |
| 41 |
_THREAD_SAFE_METHOD_ |
| 42 |
|
| 43 |
NSString *copiedString = [NSString stringWithUTF8String:p_text.utf8().get_data()]; |
| 44 |
NSArray *copiedStringArray = [NSArray arrayWithObject:copiedString]; |
| 45 |
|
| 46 |
NSPasteboard *pasteboard = [NSPasteboard generalPasteboard]; |
| 47 |
[pasteboard clearContents]; |
| 48 |
[pasteboard writeObjects:copiedStringArray]; |
| 49 |
} |
| 50 |
|
| 51 |
String DisplayServerMacOSBase::clipboard_get() const { |
| 52 |
_THREAD_SAFE_METHOD_ |
| 53 |
|
| 54 |
NSPasteboard *pasteboard = [NSPasteboard generalPasteboard]; |
| 55 |
NSArray *classArray = [NSArray arrayWithObject:[NSString class]]; |
| 56 |
NSDictionary *options = [NSDictionary dictionary]; |
| 57 |
|
| 58 |
BOOL ok = [pasteboard canReadObjectForClasses:classArray options:options]; |
| 59 |
|
| 60 |
if (!ok) { |
| 61 |
return ""; |
| 62 |
} |
| 63 |
|
| 64 |
NSArray *objectsToPaste = [pasteboard readObjectsForClasses:classArray options:options]; |
| 65 |
if (!objectsToPaste || [objectsToPaste count] < 1) { |
| 66 |
return ""; |
| 67 |
} |
| 68 |
NSString *string = [objectsToPaste objectAtIndex:0]; |
| 69 |
|
| 70 |
String ret; |
| 71 |
ret.append_utf8([string UTF8String]); |
| 72 |
return ret; |
| 73 |
} |
| 74 |
|
| 75 |
Ref<Image> DisplayServerMacOSBase::clipboard_get_image() const { |
| 76 |
Ref<Image> image; |
| 77 |
NSPasteboard *pasteboard = [NSPasteboard generalPasteboard]; |
| 78 |
NSString *result = [pasteboard availableTypeFromArray:[NSArray arrayWithObjects:NSPasteboardTypeTIFF, NSPasteboardTypePNG, nil]]; |
| 79 |
if (!result) { |
| 80 |
return image; |
| 81 |
} |
| 82 |
NSData *data = [pasteboard dataForType:result]; |
| 83 |
if (!data) { |
| 84 |
return image; |
| 85 |
} |
| 86 |
NSBitmapImageRep *bitmap = [NSBitmapImageRep imageRepWithData:data]; |
| 87 |
NSData *pngData = [bitmap representationUsingType:NSBitmapImageFileTypePNG properties:@{}]; |
| 88 |
image.instantiate(); |
| 89 |
PNGDriverCommon::png_to_image((const uint8_t *)pngData.bytes, pngData.length, false, image); |
| 90 |
return image; |
| 91 |
} |
| 92 |
|
| 93 |
bool DisplayServerMacOSBase::clipboard_has() const { |
| 94 |
NSPasteboard *pasteboard = [NSPasteboard generalPasteboard]; |
| 95 |
NSArray *classArray = [NSArray arrayWithObject:[NSString class]]; |
| 96 |
NSDictionary *options = [NSDictionary dictionary]; |
| 97 |
return [pasteboard canReadObjectForClasses:classArray options:options]; |
| 98 |
} |
| 99 |
|
| 100 |
bool DisplayServerMacOSBase::clipboard_has_image() const { |
| 101 |
NSPasteboard *pasteboard = [NSPasteboard generalPasteboard]; |
| 102 |
NSString *result = [pasteboard availableTypeFromArray:[NSArray arrayWithObjects:NSPasteboardTypeTIFF, NSPasteboardTypePNG, nil]]; |
| 103 |
return result; |
| 104 |
} |
| 105 |
|
| 106 |
void DisplayServerMacOSBase::initialize_tts() const { |
| 107 |
const_cast<DisplayServerMacOSBase *>(this)->tts = [[TTS_MacOS alloc] init]; |
| 108 |
} |
| 109 |
|
| 110 |
bool DisplayServerMacOSBase::tts_is_speaking() const { |
| 111 |
if (unlikely(!tts)) { |
| 112 |
initialize_tts(); |
| 113 |
} |
| 114 |
ERR_FAIL_NULL_V(tts, false); |
| 115 |
return [tts isSpeaking]; |
| 116 |
} |
| 117 |
|
| 118 |
bool DisplayServerMacOSBase::tts_is_paused() const { |
| 119 |
if (unlikely(!tts)) { |
| 120 |
initialize_tts(); |
| 121 |
} |
| 122 |
ERR_FAIL_NULL_V(tts, false); |
| 123 |
return [tts isPaused]; |
| 124 |
} |
| 125 |
|
| 126 |
TypedArray<Dictionary> DisplayServerMacOSBase::tts_get_voices() const { |
| 127 |
if (unlikely(!tts)) { |
| 128 |
initialize_tts(); |
| 129 |
} |
| 130 |
ERR_FAIL_NULL_V(tts, TypedArray<Dictionary>()); |
| 131 |
return [tts getVoices]; |
| 132 |
} |
| 133 |
|
| 134 |
void DisplayServerMacOSBase::tts_speak(const String &p_text, const String &p_voice, int p_volume, float p_pitch, float p_rate, int64_t p_utterance_id, bool p_interrupt) { |
| 135 |
if (unlikely(!tts)) { |
| 136 |
initialize_tts(); |
| 137 |
} |
| 138 |
ERR_FAIL_NULL(tts); |
| 139 |
[tts speak:p_text voice:p_voice volume:p_volume pitch:p_pitch rate:p_rate utterance_id:p_utterance_id interrupt:p_interrupt]; |
| 140 |
} |
| 141 |
|
| 142 |
void DisplayServerMacOSBase::tts_pause() { |
| 143 |
if (unlikely(!tts)) { |
| 144 |
initialize_tts(); |
| 145 |
} |
| 146 |
ERR_FAIL_NULL(tts); |
| 147 |
[tts pauseSpeaking]; |
| 148 |
} |
| 149 |
|
| 150 |
void DisplayServerMacOSBase::tts_resume() { |
| 151 |
if (unlikely(!tts)) { |
| 152 |
initialize_tts(); |
| 153 |
} |
| 154 |
ERR_FAIL_NULL(tts); |
| 155 |
[tts resumeSpeaking]; |
| 156 |
} |
| 157 |
|
| 158 |
void DisplayServerMacOSBase::tts_stop() { |
| 159 |
if (unlikely(!tts)) { |
| 160 |
initialize_tts(); |
| 161 |
} |
| 162 |
ERR_FAIL_NULL(tts); |
| 163 |
[tts stopSpeaking]; |
| 164 |
} |
| 165 |
|
| 166 |
void DisplayServerMacOSBase::_update_keyboard_layouts() const { |
| 167 |
kbd_layouts.clear(); |
| 168 |
current_layout = 0; |
| 169 |
|
| 170 |
TISInputSourceRef cur_source = TISCopyCurrentKeyboardInputSource(); |
| 171 |
NSString *cur_name = (__bridge NSString *)TISGetInputSourceProperty(cur_source, kTISPropertyLocalizedName); |
| 172 |
CFRelease(cur_source); |
| 173 |
|
| 174 |
// Enum IME layouts. |
| 175 |
NSDictionary *filter_ime = @{ (NSString *)kTISPropertyInputSourceType : (NSString *)kTISTypeKeyboardInputMode }; |
| 176 |
NSArray *list_ime = (__bridge NSArray *)TISCreateInputSourceList((__bridge CFDictionaryRef)filter_ime, false); |
| 177 |
for (NSUInteger i = 0; i < [list_ime count]; i++) { |
| 178 |
LayoutInfo ly; |
| 179 |
NSString *name = (__bridge NSString *)TISGetInputSourceProperty((__bridge TISInputSourceRef)[list_ime objectAtIndex:i], kTISPropertyLocalizedName); |
| 180 |
ly.name.append_utf8([name UTF8String]); |
| 181 |
|
| 182 |
NSArray *langs = (__bridge NSArray *)TISGetInputSourceProperty((__bridge TISInputSourceRef)[list_ime objectAtIndex:i], kTISPropertyInputSourceLanguages); |
| 183 |
ly.code.append_utf8([(NSString *)[langs objectAtIndex:0] UTF8String]); |
| 184 |
kbd_layouts.push_back(ly); |
| 185 |
|
| 186 |
if ([name isEqualToString:cur_name]) { |
| 187 |
current_layout = kbd_layouts.size() - 1; |
| 188 |
} |
| 189 |
} |
| 190 |
|
| 191 |
// Enum plain keyboard layouts. |
| 192 |
NSDictionary *filter_kbd = @{ (NSString *)kTISPropertyInputSourceType : (NSString *)kTISTypeKeyboardLayout }; |
| 193 |
NSArray *list_kbd = (__bridge NSArray *)TISCreateInputSourceList((__bridge CFDictionaryRef)filter_kbd, false); |
| 194 |
for (NSUInteger i = 0; i < [list_kbd count]; i++) { |
| 195 |
LayoutInfo ly; |
| 196 |
NSString *name = (__bridge NSString *)TISGetInputSourceProperty((__bridge TISInputSourceRef)[list_kbd objectAtIndex:i], kTISPropertyLocalizedName); |
| 197 |
ly.name.append_utf8([name UTF8String]); |
| 198 |
|
| 199 |
NSArray *langs = (__bridge NSArray *)TISGetInputSourceProperty((__bridge TISInputSourceRef)[list_kbd objectAtIndex:i], kTISPropertyInputSourceLanguages); |
| 200 |
ly.code.append_utf8([(NSString *)[langs objectAtIndex:0] UTF8String]); |
| 201 |
kbd_layouts.push_back(ly); |
| 202 |
|
| 203 |
if ([name isEqualToString:cur_name]) { |
| 204 |
current_layout = kbd_layouts.size() - 1; |
| 205 |
} |
| 206 |
} |
| 207 |
|
| 208 |
keyboard_layout_dirty = false; |
| 209 |
} |
| 210 |
|
| 211 |
void DisplayServerMacOSBase::_keyboard_layout_changed(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef user_info) { |
| 212 |
DisplayServerMacOSBase *ds = (DisplayServerMacOSBase *)DisplayServer::get_singleton(); |
| 213 |
if (ds) { |
| 214 |
ds->keyboard_layout_dirty = true; |
| 215 |
} |
| 216 |
} |
| 217 |
|
| 218 |
int DisplayServerMacOSBase::keyboard_get_layout_count() const { |
| 219 |
if (keyboard_layout_dirty) { |
| 220 |
_update_keyboard_layouts(); |
| 221 |
} |
| 222 |
return kbd_layouts.size(); |
| 223 |
} |
| 224 |
|
| 225 |
void DisplayServerMacOSBase::keyboard_set_current_layout(int p_index) { |
| 226 |
if (keyboard_layout_dirty) { |
| 227 |
_update_keyboard_layouts(); |
| 228 |
} |
| 229 |
|
| 230 |
ERR_FAIL_INDEX(p_index, kbd_layouts.size()); |
| 231 |
|
| 232 |
NSString *cur_name = [NSString stringWithUTF8String:kbd_layouts[p_index].name.utf8().get_data()]; |
| 233 |
|
| 234 |
NSDictionary *filter_kbd = @{ (NSString *)kTISPropertyInputSourceType : (NSString *)kTISTypeKeyboardLayout }; |
| 235 |
NSArray *list_kbd = (__bridge NSArray *)TISCreateInputSourceList((__bridge CFDictionaryRef)filter_kbd, false); |
| 236 |
for (NSUInteger i = 0; i < [list_kbd count]; i++) { |
| 237 |
NSString *name = (__bridge NSString *)TISGetInputSourceProperty((__bridge TISInputSourceRef)[list_kbd objectAtIndex:i], kTISPropertyLocalizedName); |
| 238 |
if ([name isEqualToString:cur_name]) { |
| 239 |
TISSelectInputSource((__bridge TISInputSourceRef)[list_kbd objectAtIndex:i]); |
| 240 |
break; |
| 241 |
} |
| 242 |
} |
| 243 |
|
| 244 |
NSDictionary *filter_ime = @{ (NSString *)kTISPropertyInputSourceType : (NSString *)kTISTypeKeyboardInputMode }; |
| 245 |
NSArray *list_ime = (__bridge NSArray *)TISCreateInputSourceList((__bridge CFDictionaryRef)filter_ime, false); |
| 246 |
for (NSUInteger i = 0; i < [list_ime count]; i++) { |
| 247 |
NSString *name = (__bridge NSString *)TISGetInputSourceProperty((__bridge TISInputSourceRef)[list_ime objectAtIndex:i], kTISPropertyLocalizedName); |
| 248 |
if ([name isEqualToString:cur_name]) { |
| 249 |
TISSelectInputSource((__bridge TISInputSourceRef)[list_ime objectAtIndex:i]); |
| 250 |
break; |
| 251 |
} |
| 252 |
} |
| 253 |
} |
| 254 |
|
| 255 |
int DisplayServerMacOSBase::keyboard_get_current_layout() const { |
| 256 |
if (keyboard_layout_dirty) { |
| 257 |
_update_keyboard_layouts(); |
| 258 |
} |
| 259 |
|
| 260 |
return current_layout; |
| 261 |
} |
| 262 |
|
| 263 |
String DisplayServerMacOSBase::keyboard_get_layout_language(int p_index) const { |
| 264 |
if (keyboard_layout_dirty) { |
| 265 |
_update_keyboard_layouts(); |
| 266 |
} |
| 267 |
|
| 268 |
ERR_FAIL_INDEX_V(p_index, kbd_layouts.size(), ""); |
| 269 |
return kbd_layouts[p_index].code; |
| 270 |
} |
| 271 |
|
| 272 |
String DisplayServerMacOSBase::keyboard_get_layout_name(int p_index) const { |
| 273 |
if (keyboard_layout_dirty) { |
| 274 |
_update_keyboard_layouts(); |
| 275 |
} |
| 276 |
|
| 277 |
ERR_FAIL_INDEX_V(p_index, kbd_layouts.size(), ""); |
| 278 |
return kbd_layouts[p_index].name; |
| 279 |
} |
| 280 |
|
| 281 |
Key DisplayServerMacOSBase::keyboard_get_keycode_from_physical(Key p_keycode) const { |
| 282 |
if (p_keycode == Key::PAUSE || p_keycode == Key::NONE) { |
| 283 |
return p_keycode; |
| 284 |
} |
| 285 |
|
| 286 |
Key modifiers = p_keycode & KeyModifierMask::MODIFIER_MASK; |
| 287 |
Key keycode_no_mod = p_keycode & KeyModifierMask::CODE_MASK; |
| 288 |
unsigned int macos_keycode = KeyMappingMacOS::unmap_key(keycode_no_mod); |
| 289 |
return (Key)(KeyMappingMacOS::remap_key(macos_keycode, 0, false) | modifiers); |
| 290 |
} |
| 291 |
|
| 292 |
Key DisplayServerMacOSBase::keyboard_get_label_from_physical(Key p_keycode) const { |
| 293 |
if (p_keycode == Key::PAUSE || p_keycode == Key::NONE) { |
| 294 |
return p_keycode; |
| 295 |
} |
| 296 |
|
| 297 |
Key modifiers = p_keycode & KeyModifierMask::MODIFIER_MASK; |
| 298 |
Key keycode_no_mod = p_keycode & KeyModifierMask::CODE_MASK; |
| 299 |
unsigned int macos_keycode = KeyMappingMacOS::unmap_key(keycode_no_mod); |
| 300 |
return (Key)(KeyMappingMacOS::remap_key(macos_keycode, 0, true) | modifiers); |
| 301 |
} |
| 302 |
|
| 303 |
void DisplayServerMacOSBase::show_emoji_and_symbol_picker() const { |
| 304 |
[[NSApplication sharedApplication] orderFrontCharacterPalette:nil]; |
| 305 |
} |
| 306 |
|
| 307 |
bool DisplayServerMacOSBase::is_dark_mode_supported() const { |
| 308 |
if (@available(macOS 10.14, *)) { |
| 309 |
return true; |
| 310 |
} else { |
| 311 |
return false; |
| 312 |
} |
| 313 |
} |
| 314 |
|
| 315 |
bool DisplayServerMacOSBase::is_dark_mode() const { |
| 316 |
if (@available(macOS 10.14, *)) { |
| 317 |
if (![[NSUserDefaults standardUserDefaults] objectForKey:@"AppleInterfaceStyle"]) { |
| 318 |
return false; |
| 319 |
} else { |
| 320 |
return ([[[NSUserDefaults standardUserDefaults] stringForKey:@"AppleInterfaceStyle"] isEqual:@"Dark"]); |
| 321 |
} |
| 322 |
} else { |
| 323 |
return false; |
| 324 |
} |
| 325 |
} |
| 326 |
|
| 327 |
Color DisplayServerMacOSBase::get_accent_color() const { |
| 328 |
if (@available(macOS 10.14, *)) { |
| 329 |
__block NSColor *color = nullptr; |
| 330 |
if (@available(macOS 11.0, *)) { |
| 331 |
[NSApp.effectiveAppearance performAsCurrentDrawingAppearance:^{ |
| 332 |
color = [[NSColor controlAccentColor] colorUsingColorSpace:[NSColorSpace genericRGBColorSpace]]; |
| 333 |
}]; |
| 334 |
if (!color) { |
| 335 |
color = [[NSColor controlAccentColor] colorUsingColorSpace:[NSColorSpace genericRGBColorSpace]]; |
| 336 |
} |
| 337 |
} else { |
| 338 |
NSAppearance *saved_appearance = [NSAppearance currentAppearance]; |
| 339 |
[NSAppearance setCurrentAppearance:[NSApp effectiveAppearance]]; |
| 340 |
color = [[NSColor controlAccentColor] colorUsingColorSpace:[NSColorSpace genericRGBColorSpace]]; |
| 341 |
[NSAppearance setCurrentAppearance:saved_appearance]; |
| 342 |
} |
| 343 |
if (color) { |
| 344 |
CGFloat components[4]; |
| 345 |
[color getRed:&components[0] green:&components[1] blue:&components[2] alpha:&components[3]]; |
| 346 |
return Color(components[0], components[1], components[2], components[3]); |
| 347 |
} else { |
| 348 |
return Color(0, 0, 0, 0); |
| 349 |
} |
| 350 |
} else { |
| 351 |
return Color(0, 0, 0, 0); |
| 352 |
} |
| 353 |
} |
| 354 |
|
| 355 |
Color DisplayServerMacOSBase::get_base_color() const { |
| 356 |
if (@available(macOS 10.14, *)) { |
| 357 |
__block NSColor *color = nullptr; |
| 358 |
if (@available(macOS 11.0, *)) { |
| 359 |
[NSApp.effectiveAppearance performAsCurrentDrawingAppearance:^{ |
| 360 |
color = [[NSColor windowBackgroundColor] colorUsingColorSpace:[NSColorSpace genericRGBColorSpace]]; |
| 361 |
}]; |
| 362 |
if (!color) { |
| 363 |
color = [[NSColor controlColor] colorUsingColorSpace:[NSColorSpace genericRGBColorSpace]]; |
| 364 |
} |
| 365 |
} else { |
| 366 |
NSAppearance *saved_appearance = [NSAppearance currentAppearance]; |
| 367 |
[NSAppearance setCurrentAppearance:[NSApp effectiveAppearance]]; |
| 368 |
color = [[NSColor controlColor] colorUsingColorSpace:[NSColorSpace genericRGBColorSpace]]; |
| 369 |
[NSAppearance setCurrentAppearance:saved_appearance]; |
| 370 |
} |
| 371 |
if (color) { |
| 372 |
CGFloat components[4]; |
| 373 |
[color getRed:&components[0] green:&components[1] blue:&components[2] alpha:&components[3]]; |
| 374 |
return Color(components[0], components[1], components[2], components[3]); |
| 375 |
} else { |
| 376 |
return Color(0, 0, 0, 0); |
| 377 |
} |
| 378 |
} else { |
| 379 |
return Color(0, 0, 0, 0); |
| 380 |
} |
| 381 |
} |
| 382 |
|
| 383 |
void DisplayServerMacOSBase::set_system_theme_change_callback(const Callable &p_callable) { |
| 384 |
system_theme_changed = p_callable; |
| 385 |
} |
| 386 |
|
| 387 |
void DisplayServerMacOSBase::emit_system_theme_changed() { |
| 388 |
if (system_theme_changed.is_valid()) { |
| 389 |
Variant ret; |
| 390 |
Callable::CallError ce; |
| 391 |
system_theme_changed.callp(nullptr, 0, ret, ce); |
| 392 |
if (ce.error != Callable::CallError::CALL_OK) { |
| 393 |
ERR_PRINT(vformat("Failed to execute system theme changed callback: %s.", Variant::get_callable_error_text(system_theme_changed, nullptr, 0, ce))); |
| 394 |
} |
| 395 |
} |
| 396 |
} |
| 397 |
|
| 398 |
DisplayServerMacOSBase::DisplayServerMacOSBase() { |
| 399 |
KeyMappingMacOS::initialize(); |
| 400 |
|
| 401 |
// Init TTS |
| 402 |
bool tts_enabled = GLOBAL_GET("audio/general/text_to_speech"); |
| 403 |
if (tts_enabled) { |
| 404 |
initialize_tts(); |
| 405 |
} |
| 406 |
|
| 407 |
// Register to be notified on keyboard layout changes. |
| 408 |
CFNotificationCenterAddObserver(CFNotificationCenterGetDistributedCenter(), |
| 409 |
nullptr, _keyboard_layout_changed, |
| 410 |
kTISNotifySelectedKeyboardInputSourceChanged, nullptr, |
| 411 |
CFNotificationSuspensionBehaviorDeliverImmediately); |
| 412 |
} |
| 413 |
|
| 414 |
DisplayServerMacOSBase::~DisplayServerMacOSBase() { |
| 415 |
CFNotificationCenterRemoveObserver(CFNotificationCenterGetDistributedCenter(), nullptr, kTISNotifySelectedKeyboardInputSourceChanged, nullptr); |
| 416 |
} |