On Thu Apr 3 02:20:03 2025 +0000, Byeongsik Jeon wrote:
Here, is there a reason why ret is TRUE? ImeProcessKey should return FALSE if ime does not handle key events. To avoid unnecessary code execution and waiting, my opinion is that the fix should be made earlier in macdrv_ImeProcessKey().
In my opinion, from the perspective of ImeProcessKey, key up events *are* handled if there's an active macOS input source. They shouldn't go to the inputContext, but they are paired with a key down event that did, so they are effectively consumed. I'm not sure how ImeProcessKey usually gets used, but it strikes me that having it return true for unpaired key up events like that would be unexpected.
You're right that handling it a level up in macdrv_ImeProcessKey seems better, to avoid the dispatch to the main thread and the subsequent wait. I'll update the patch.