I am trying to allow the user to switch between keyboards, such as switching from Qwerty to a smiley keyboard. I am having trouble with understanding the concept of how users are able to switch from Qwerty to emoticons by the use of the shift or on iPhones by the globe button. I'm confused on how to code the actual "switch". I found the below code in the softkeyboard SDK sample and I'm wondering if this is how the switch takes place.
private void handleShift() {
if (mInputView == null) {
return;
}
Keyboard currentKeyboard = mInputView.getKeyboard();
if (mQwertyKeyboard == currentKeyboard) {
// Alphabet keyboard
checkToggleCapsLock();
mInputView.setShifted(mCapsLock || !mInputView.isShifted());
} else if (currentKeyboard == mSymbolsKeyboard) {
mSymbolsKeyboard.setShifted(true);
mInputView.setKeyboard(mSymbolsShiftedKeyboard);
mSymbolsShiftedKeyboard.setShifted(true);
} else if (currentKeyboard == mSymbolsShiftedKeyboard) {
mSymbolsShiftedKeyboard.setShifted(false);
mInputView.setKeyboard(mSymbolsKeyboard);
mSymbolsKeyboard.setShifted(false);
}
}
Again I am trying to initialize a switch that allow the users to press the shift button and switch to emoticons and once selected switch back to qwerty to send...