Updated IME event handling