I developed my own keyboard for typing Urdu text, but there is an issue when I disable the default soft keyboard then.
- Cursor on EditText will disappear.
- Unable to Tab on EditText and remove the word from mid of EditText.
- When I enable the cursor on EditText, then both keyboards (layoutKeyboard and default soft keyboard) show at the same time.
I use this code to hide the default keyboard and enable it on the keyboard.
private void setKeysBoard(boolean MyKeyBoardEnabled) {
if (MyKeyBoardEnabled) {
hideSoftKeyboard();
search.setCursorVisible(true);
search.setFocusable(true);
search.setFocusableInTouchMode(false);
findViewById(R.id.mykeyboard).setVisibility(View.VISIBLE);
} else {
findViewById(R.id.mykeyboard).setVisibility(View.GONE);
search.requestFocus();
search.setCursorVisible(true);
search.setFocusable(true);
search.setFocusableInTouchMode(true);
}
}
private void hideSoftKeyboard() {
View view = this.getCurrentFocus();
if (view != null) {
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm != null) {
if (android.os.Build.VERSION.SDK_INT >= 28) {
imm.hideSoftInputFromWindow(findViewById(android.R.id.content).getWindowToken(), 0);
} else imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
}
view.clearFocus();
}
}
I want to show my own keyboard with the cursor and copy/paste features as well. I also disabled my keyboard and enabled the default one and how to code for it.
