I customize my own soft keyboard by implementing the KeyboardView.OnKeyboardActionListener interface.
When the keys are pressed, it will show a preview popup.
My problem is how to disable the preview popup for special keys such as SHIFT and DELETE?
I have tried to set the android:iconPreview attribute to null but it didn't work.
<Key
android:codes="-1"
android:keyIcon="@drawable/key_shift"
android:keyWidth="15%p"
android:isModifier="true"
android:isSticky="true"
android:keyEdgeFlags="left" />
Have any idea?
Thanks in advance!
Key is anchored to the left of the keyboard. Key is anchored to the right of the keyboard.
First you must implement OnKeyboardActionListener
then use onPress() and onRelease() to control the preview popup like this:
public void onPress(int primaryCode) {
if (primaryCode==-2||primaryCode==-5||primaryCode==-4){
mInputView.setPreviewEnabled(false);
}
}
public void onRelease(int primaryCode) {
mInputView.setPreviewEnabled(true);
}
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