inputconnection

InputConnection text committing not working

♀尐吖头ヾ 提交于 2019-12-11 14:24:57
问题 In my onCreateInputView of InputMethodService I have a BroadcastReceiver, that listens for events from my application. My BroadcastReceiver get the text and try to insert into current text field.problem is text never inserted into the current textfield everthing working fine except text not inseted in editText filed. Here I am posting my code snippset @Override public View onCreateInputView() { kv = (KeyboardView) getLayoutInflater().inflate(R.layout.activity_main, null); keyboard = new

How to commit composing text to an InputConnection when the user changes the selection

一曲冷凌霜 提交于 2019-12-11 07:33:07
问题 I am making a custom keyboard and have to set composing text before committing it. This is described in this Q&A. I know how to commit text in general inputConnection.commitText("text", 1); But I don't know how to commit it if the user changes the cursor location by touching another part of the EditText . From observing other keyboards I know it is possible because they do it. But in my keyboard if I have inputConnection.setComposingText("text", 1); and then change the cursor position, the

How to make delete key- delete all selected edit text in custom android keyboard

痞子三分冷 提交于 2019-12-10 23:06:03
问题 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. 回答1: 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

How to implement Extracted Text for a custom Android View

被刻印的时光 ゝ 提交于 2019-12-08 17:06:14
问题 Background A custom editor view in Android is able to receive text from a system keyboard though an InputConnection . I have been able to make such a view successfully. However, when the device is in landscape mode, the system will sometimes choose to show a extracted text view. When users type in this mode the extracted text view should be updated with the same text that is in the custom view. I have not been able to implement the extracted text view functionality. (Here are some things I've

input connection-how to delete selected text?

纵饮孤独 提交于 2019-12-07 11:37:40
问题 I made a custom keyboard for android. When I press backspace button of my keyboard I use getCurrentInputConnection().deleteSurroundingText(1, 0); to delete one letter from the input field. But when I select some text and then press the backspace button, the selected text is not deleted. What method in input connection should I use so that selected text is also deleted from my keyboard when I press the backspace button? 回答1: Call getCurrentInputConnection().commitText("",1); 回答2: When deleting

Set composing text on an EditText from a custom keyboard in Android

旧巷老猫 提交于 2019-12-02 04:46:20
问题 Explanation of what I am trying to do I'm making a custom in-app keyboard that works on the same principle of this example. However, in my keyboard I'm using popup windows to display extra letter forms. In traditional Mongolian letters have different forms depending on if they are located at the beginning, middle, or end of a word. Usually these can be determined from the context, but sometimes a user needs to choose an alternate form explicitly from the popup key candidates. Lets say that a