I'm using the soft keyboard for Android 3.2. The problem is I can't find the keyCode
for the button on the bottom left that minimizes the keyboard.
I used a switch case for onKeyDown
to display the keyCode
and it seems to be the only one without a value. I figured it would have the same code as the back button since that is what it replaces but no such luck.
Simple. Download the Gboard - the Google Keyboard – Apps on Google Play - and then go to the settings section on your Android device >> General Management >> Language and Input >> Default Keyboard (Select Gboard).
To handle an individual key press, implement onKeyDown() or onKeyUp() as appropriate. Usually, you should use onKeyUp() if you want to be sure that you receive only one event. If the user presses and holds the button, then onKeyDown() is called multiple times.
It is just the back button. You can just do this by overriding its behavior, with :
InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
mgr.hideSoftInputFromWindow(editText.getWindowToken(), 0);
and :
@Override
boolean onKeyDown(int keyCode, KeyEvent event) {
//hide the soft keyboard
super.onKeyDown(keyCode, event);
}
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