I am making a custom keyboard that I want to include in an app. I already know how to make a system keyboard. I don't want to do that because it requires installing by the user.
Whenever the user presses a key on the keyboard it should send the key text to whichever EditText
currently has focus (if any).
An editor needs to interact with the IME, receiving commands through this
InputConnection
interface, and sending commands throughInputMethodManager
.
This is illustrated in the following image (where View
is an EditText
).
This makes it sound like I should be using an input connection to communicate with the EditText
. So my question is, how does my custom keyboard view get a reference to the currently focused EditText
's input connection. Or how does it start that connection?
Related