From bc6929e964ec35b85819083849cbe209a5ff3327 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Tue, 28 Oct 2008 06:20:22 +0000 Subject: [PATCH] Added key bindings in message view --- src/com/fsck/k9/activity/MessageView.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/com/fsck/k9/activity/MessageView.java b/src/com/fsck/k9/activity/MessageView.java index 40a4aea2b..19fb1a5c5 100644 --- a/src/com/fsck/k9/activity/MessageView.java +++ b/src/com/fsck/k9/activity/MessageView.java @@ -28,6 +28,7 @@ import android.os.Process; import android.text.util.Regex; import android.util.Config; import android.util.Log; +import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; @@ -95,6 +96,23 @@ public class MessageView extends Activity private Listener mListener = new Listener(); private MessageViewHandler mHandler = new MessageViewHandler(); + + + + public boolean onKeyDown(int keyCode, KeyEvent event) { + switch (keyCode) { + case KeyEvent.KEYCODE_DEL: { onDelete(); break;} + case KeyEvent.KEYCODE_F: { onForward(); break;} + case KeyEvent.KEYCODE_A: { onReplyAll(); break; } + case KeyEvent.KEYCODE_R: { onReply(); break; } + case KeyEvent.KEYCODE_J: { onPrevious(); break; } + case KeyEvent.KEYCODE_K: { onNext(); break; } + } + return true; + } + + + class MessageViewHandler extends Handler { private static final int MSG_PROGRESS = 2; private static final int MSG_ADD_ATTACHMENT = 3; @@ -218,6 +236,9 @@ public class MessageView extends Activity msg.arg1 = show ? 1 : 0; sendMessage(msg); } + + + } class Attachment {