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 keyboard which will have no need for them.
From what I think I understand, the picture below is the actual popup keyboard that you can choose to show using android:popupKeyboard
and android:popupCharacters
in the Keyboard.Key
XML.
But the image below is not the same (also see this picture). Is there a way to turn the following off, using XML or even programmatically?
Going to settings app and selecting Apps & notifications:And finally clicking on Android Keyboard (AOSP) entry in the app list: Clicking on Disable button and confirming in a pop-up dialog will disable on-screen android keyboard from appearing when trying to type.
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.
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;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With