public void AlterKeyboard() { // switch if more than 1 keyboard if (LocaleArray.Length > 1) { if (curLocale != KeyboardLanguage.Symbol) { Symbol _localeSYM = (Symbol)htLocaleArray [KeyboardLanguage.Symbol]; if (_localeSYM != null) { #if UNITY_EDITOR Debug.Log(LOG_TAG + ", AlterKeyboard() switch to symbol keyboard."); #endif KMInstance.DeactivateAllKeyboards(); _localeSYM.ActivateCurrentKeyboard(); originLocale = curLocale; // original locale before switching to Symbol curLocale = KeyboardLanguage.Symbol; } } else { KMInstance.DeactivateAllKeyboards(); if (LocaleArray [0] == KeyboardLanguage.Symbol) { // Default (LocaleArray[0]) keyboard is Symbol, switch to 2nd (LocaleArray[1]) keyboard. Locale _locale = (Locale)htLocaleArray[LocaleArray[1]]; #if UNITY_EDITOR Debug.Log(LOG_TAG + ", AlterKeyboard() switch to " + _locale + " keyboard."); #endif _locale.ActivateCurrentKeyboard(); curLocale = LocaleArray [1]; } else { // Switch back from Symbol Locale _locale = (Locale)htLocaleArray[originLocale]; #if UNITY_EDITOR Debug.Log(LOG_TAG + ", AlterKeyboard() switch back to " + _locale + " keyboard."); #endif _locale.ActivateCurrentKeyboard(); curLocale = originLocale; } } } }
public void OnCloseKeyboard() { KMInstance.DeactivateAllKeyboards(); }