diff options
Diffstat (limited to 'src/us')
-rw-r--r-- | src/us/minak/IMEView.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/us/minak/IMEView.java b/src/us/minak/IMEView.java index dd2fb69..31ce553 100644 --- a/src/us/minak/IMEView.java +++ b/src/us/minak/IMEView.java @@ -2,7 +2,9 @@ package us.minak; import android.content.Context; import android.util.AttributeSet; +import android.widget.Button; import android.widget.RelativeLayout; +import android.view.View; import android.view.inputmethod.InputConnection; /** @@ -17,6 +19,12 @@ public class IMEView extends RelativeLayout implements InputConnectionGetter { protected void onFinishInflate() { IMEGestureOverlayView gestureOverlayView = (IMEGestureOverlayView) findViewById(R.id.drawing_space); gestureOverlayView.setInputConnectionGetter(this); + + final Button backspaceButton = (Button) findViewById(R.id.backspace_btn); + backspaceButton.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { backspace(); } + }); } private InputConnectionGetter icGetter = new InputConnectionGetter.NullGetter(); @@ -27,4 +35,10 @@ public class IMEView extends RelativeLayout implements InputConnectionGetter { public InputConnection getCurrentInputConnection() { return icGetter.getCurrentInputConnection(); } + + private void backspace() { + InputConnection ic = getCurrentInputConnection(); + if (ic != null) + ic.deleteSurroundingText(1, 0); + } } |