A neat pointer to the material brightness LEDs from @Anoop Vaidya - looks interesting!
The system sends a notification when the input method changes.
First declare a function to receive a notification:
void theKeyboardChanged(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) { NSLog(@"Keyboard/input method changed."); }
Then register for a change notification:
CFNotificationCenterAddObserver(CFNotificationCenterGetDistributedCenter(), myContextInfo, theKeyboardChanged, kTISNotifySelectedKeyboardInputSourceChanged, NULL, CFNotificationSuspensionBehaviorDeliverImmediately);
source share