Android エディタ アプリは、左矢印として解釈されるときにキーボード アプリが送信することを期待しているキー コードは何ですか? 言い換えれば、ユーザーがカーソルを 1 文字左に移動する場合、キーボード プログラムは呼び出し側プログラム (ある種のエディター) に何を送信する必要があるのでしょうか? 関連する問題: 「android:codes」属性のマイナス値は何を意味しますか? ()これらの問題へのポインタは高く評価されます。
1 に答える
0
I know it's been a long time since you asked this, but I thought I'd throw in my two cents. What I would try in your situation would be this:
InputConnection ic = getCurrentInputConnection();
String textAbove = ic.getTextBeforeCursor(0x100000, 0).toString();
int cursorPos = textAbove.length();
if (cursorPos>0) ic.setSelection(cursorPos-1, cursorPos-1);
That should simulate a left arrow pretty decently.
于 2011-01-07T04:49:22.373 に答える