What I\'m looking to do is hide only the popups that show what key you are currently pressing while using a soft keyboard. Is this possible? I am creating my own new keyboar
public void onPress(int primaryCode) {
mInputView.setPreviewEnabled(false);
}
public void onRelease(int primaryCode) {
mInputView.setPreviewEnabled(true); //Change to false if you want remove too for the Del key when it's pressed
}
Additionally, To get the view and universally disable the preview from within a custom class extending InputMethodService
private KeyboardView mInputView;
@Override
public KeyboardView onCreateInputView() {
mInputView = (KeyboardView)getLayoutInflater().inflate(R.layout.keyboard, null);
mInputView .setPreviewEnabled(false);
return mInputView;
}
After reading a little bit of the actual android keyboard source code:
What I was referring to was the "key preview", which is "a popup that shows a magnified version of the depressed key." By default the preview is enabled, but to disable it, simply enough, is setPreviewEnabled(boolean previewEnabled)
. Which is a method from the KeyboardView
class. API.