I am creating custom android keyboard and I want delete key to delete all the edit text if they are selected.
i.e, when text is selected, clipboard(cut,copy,paste comes up); in that mode , if the delete key is pressed, it should delete all. It doesn't currently.
P.S don't tell me for a specific edit text, it is a custom keyboard, it won't have access to edit text.
You can also see if the
InputConnection
has any selected text withgetSelectedText
. Then delete it if it does (or delete the preceding character if it doesn't).I don't see why it won't. In the keyboard, I created, I just send out the delete key event and it works like a charm. Try the following when delete/backspace key is pressed while something is selected.