• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

development


Commit MetaInfo

Revisão729ff799f77fff783ba1fa46d9adb57e500e4150 (tree)
Hora2009-03-28 07:49:45
AutorJack Palevich <>
CommiterThe Android Open Source Project

Mensagem de Log

AI 143256: Make the Term emulator work with the most recent keyboard IME.

+ Makes the "Enter" key work again.
+ Makes the "Delete" key delete just one character each time you press it
instead of two.
BUG=1615131

Automated import of CL 143256

Mudança Sumário

Diff

--- a/apps/Term/src/com/android/term/Term.java
+++ b/apps/Term/src/com/android/term/Term.java
@@ -548,16 +548,6 @@ public class Term extends Activity {
548548 + controlKey + " 6 ==> Control-^").
549549 show();
550550 }
551-
552- private void print(String msg) {
553- char[] chars = msg.toCharArray();
554- int len = chars.length;
555- byte[] bytes = new byte[len];
556- for (int i = 0; i < len; i++) {
557- bytes[i] = (byte) chars[i];
558- }
559- mEmulatorView.append(bytes, 0, len);
560- }
561551 }
562552
563553
@@ -2707,8 +2697,13 @@ class EmulatorView extends View implements GestureDetector.OnGestureListener {
27072697 return null;
27082698 }
27092699
2710- public boolean hideStatusIcon() {
2711- return true;
2700+ public boolean performEditorAction(int actionCode) {
2701+ if(actionCode == EditorInfo.IME_ACTION_UNSPECIFIED) {
2702+ // The "return" key has been pressed on the IME.
2703+ sendText("\n");
2704+ return true;
2705+ }
2706+ return false;
27122707 }
27132708
27142709 public boolean performContextMenuAction(int id) {
@@ -2720,13 +2715,12 @@ class EmulatorView extends View implements GestureDetector.OnGestureListener {
27202715 }
27212716
27222717 public boolean sendKeyEvent(KeyEvent event) {
2723- switch(event.getKeyCode()) {
2724- case KeyEvent.KEYCODE_ENTER:
2725- sendChar('\r');
2726- break;
2727- case KeyEvent.KEYCODE_DEL:
2728- sendChar(127);
2729- break;
2718+ if (event.getAction() == KeyEvent.ACTION_DOWN) {
2719+ switch(event.getKeyCode()) {
2720+ case KeyEvent.KEYCODE_DEL:
2721+ sendChar(127);
2722+ break;
2723+ }
27302724 }
27312725 return true;
27322726 }
@@ -2739,10 +2733,6 @@ class EmulatorView extends View implements GestureDetector.OnGestureListener {
27392733 return true;
27402734 }
27412735
2742- public boolean showStatusIcon(String packageName, int resId) {
2743- return true;
2744- }
2745-
27462736 private void sendChar(int c) {
27472737 try {
27482738 mTermOut.write(c);