Example #1
0
 private void a(CommitText text, EditableLineView mTextView, EditableLineViewBuffer mTextBuffer) {
   // android.util.Log.v("kiyo","#key= #");
   //		 android.util.Log.v("kiyo","#key= #"+text.getText().length()
   //				 +","+text.getText().charAt(0)+","
   //				 +text.pushingCtrl()+","+ text.pushingAlt());
   if (text.getText() != null
       && text.getText().length() == 1
       && mManager.update(
           text.getText().charAt(0),
           text.pushingCtrl(),
           text.pushingAlt(),
           mTextView,
           mTextBuffer)) {
     //			android.util.Log.v("kiyo","key= ++");
     return;
   } else {
     //			android.util.Log.v("kiyo","key= --");
     mManager.clear();
   }
   mTextBuffer.clearYank();
   if (text.isKeyCode()) {
     // android.util.Log.v("kiyo","#key  --1-- ="+text.getKeyCode());
     mManager.update(
         text.getKeyCode(), text.pushingCtrl(), text.pushingAlt(), mTextView, mTextBuffer);
   } else {
     // android.util.Log.v("kiyo","#key  --2-- ="+text.getText());
     if (getMode().toString().startsWith(CursorableLineView.MODE_EDIT)) {
       //
       mTextBuffer.pushCommit(text.getText(), text.getNewCursorPosition());
     }
   }
 }
Example #2
0
  public void updateCommitTextFromIME(
      EditableLineView mTextView, EditableLineViewBuffer mTextBuffer) {
    // following code is yaxutuke sigoto
    if (!mTextView.isFocus()) {
      return;
    }
    setMode(mTextView.getMode());
    if (mTextView.getMyInputConnection() == null) {
      return;
    }
    mTextView.getMyInputConnection().setIMEController(KeyEventManager.this);
    MyInputConnection c = mTextView.getMyInputConnection();
    if (c == null) {
      return;
    }

    mTextBuffer.IsCrlfMode(mTextView.isCrlfMode());

    boolean first = true;
    while (true) {
      CommitText text = c.popFirst();
      if (text != null) {
        mTextView.getStage(mTextView).resetTimer();
        if (first == true) {
          cursorIsInShowingView(mTextView);
          first = false;
        }
        // android.util.Log.v("kiyo","key= #");
        mTextBuffer.setCursor(
            mTextView.getLeft().getCursorRow(), mTextView.getLeft().getCursorCol());
        a(text, mTextView, mTextBuffer);
        mTextView.getLeft().setCursorRow(mTextBuffer.getRow());
        mTextView.getLeft().setCursorCol(mTextBuffer.getCol());
      } else {
        break;
      }
    }
  }