When TISGetInputSourceProperty( *, kTISPropertyUnicodeKeyLayoutData) returns NULL

I happened to use Korean input method when I launched a S/W program. Then it crashed at accessing the resultant object of TISGetInputSourceProperty().

https://github.com/ianyh/Amethyst/blob/master/Amethyst/AMHotKeyManager.m#L115

They say Japanese keyboard caused returning NULL. I will add Korean input method to that.

Here are two things to be aware of :

  • What is interesting is that kTISPropertyUnicodeKeyLayoutData is still used when it queries last ASCII capable keyboard.
  • It is TISCopyCurrentASCIICapableKeyboardLayoutInputSource() not TISCopyCurrentASCIICapableKeyboardInputSource() to call. The latter doesn’t guarantee that it would return an keyboard input with a layout.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: