def handleIMEEvent(event): import GUI handled = False import LanguageIndicator LanguageIndicator.handleIMEEvent(event) focused = getFocusedComponent() if focused is not None and hasattr(focused.script, 'handleIMEEvent'): handled = focused.script.handleIMEEvent(event) import BigWorld if BigWorld.ime.state == 'OFF': IME.hideAll() return handled