Hi Björn, I made a patch of TIS handling for cooperation with iminsert/imsearch.
Explanation of this patch: > NOTE: Check IM state _before_ key has been interpreted or we'll pick up > the old IM state when it has been switched via a keyboard shortcut that > MacVim cannot handle. A keyboard shortcut for switching IM state (link Command-Space) does not reach MacVim. So MacVim checks IM state when keyDown: called. I modified the timing of checking IM state in keyDown: method. Case of checking IM state before/after ESC key: before: IM switch(off>on) > check IM state(on) > handle key > save iminsert(on) after : IM switch(off>on) > handle key > save iminsert(off) > check IM state(on) I expected _before_ behavior. BTW, I tried to use CFNotificationCenterAddObserver with kTISNotifySelectedKeyboardInputSourceChanged for handling when IM is enabled/disabled, but I couldn't. http://developer.apple.com/documentation/TextFonts/Reference/TextInputSourcesReference/Reference/reference.html#//apple_ref/doc/uid/TP40006199-CH4-SW1 > HACK! interpretKeyEvents: does not call doCommandBySelector: > with Ctrl-6 or Ctrl-^ when IM is active. Ctrl-^ switches IM state in Vim, it works properly on MacVim when IM is not active. So I hacked handling Ctrl-6 and Ctrl-^ when IM is active. > Save current locale input source for use when IM is active and > get an ASCII source for use when IM is deactivated (by Vim). Ctrl-^ could not switch IM state without it. sakamoto --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_mac" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
0001-modify-TIS-handling-for-cooperation-with-iminsert-im.patch
Description: Binary data
