Following this tutorial I have created a fully working Android OS keyboard. it is a standard qwerty alpha/numeric.
I have a second keyboard mark-up for numeric keyboard.
What I can't seem to detect is what type of keyboard is being specified by the text input box. The edittext specifies the type
editText.setInputType(InputType.TYPE_CLASS_TEXT);
but how does my IME service detect this so it can present the correct keyboard?
public class MyKeybdIME extends InputMethodService implements KeyboardView.OnKeyboardActionListener {
private KeyboardView kv;
private Keyboard keyboard;
private Keyboard numboard;
private boolean caps = false;
@Override
public View onCreateInputView() {
kv = (MKeyboardView)getLayoutInflater().inflate(R.layout.keyboard, null);
keyboard = new Keyboard(this, R.xml.qwertyfull);
numboard = new Keyboard(this, R.xml.num);
// InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
//How can you detect what is being asked for?
// imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);
// Or am I on the wrong path for this part?
kv.setKeyboard(keyboard);//... Or numboard when the entry requests a numeric keyboard
kv.setOnKeyboardActionListener(this);
return kv;
}