Mercurial > 510Connectbot
changeset 149:eff82d6c11d9
add ptt button p2 preference
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Sun, 22 Jun 2014 13:04:37 -0700 |
parents | 69333ca1563c |
children | 83bb2734b14c |
files | res/values/strings.xml src/com/five_ten_sg/connectbot/service/TerminalKeyListener.java |
diffstat | 2 files changed, 12 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/res/values/strings.xml Sun Jun 22 13:02:36 2014 -0700 +++ b/res/values/strings.xml Sun Jun 22 13:04:37 2014 -0700 @@ -476,6 +476,8 @@ <string name="list_hwbutton_ctrla">"Ctrl+A"</string> <!-- Selection to indicate pressing a hardware button should send "Esc+A". --> <string name="list_hwbutton_esc_a">"Esc+A"</string> + <!-- Selection to indicate pressing a hardware button should notify the monitor. --> + <string name="list_hwbutton_monitor">"Monitor Key"</string> <!-- Selection to indicate pressing a hardware button should send nothing at all. --> <string name="list_hwbutton_none">"None"</string>
--- a/src/com/five_ten_sg/connectbot/service/TerminalKeyListener.java Sun Jun 22 13:02:36 2014 -0700 +++ b/src/com/five_ten_sg/connectbot/service/TerminalKeyListener.java Sun Jun 22 13:04:37 2014 -0700 @@ -486,6 +486,13 @@ PreferenceConstants.HWBUTTON_ESC); return (handleShortcut(v, hwbuttonShortcut)); + case KeyEvent.KEYCODE_BUTTON_L2: + // check to see which shortcut the ptt button triggers + hwbuttonShortcut = manager.prefs.getString( + PreferenceConstants.PTT, + PreferenceConstants.HWBUTTON_MONITOR); + return (handleShortcut(v, hwbuttonShortcut)); + case KeyEvent.KEYCODE_DEL: if ((metaState & META_ALT_MASK) != 0) { buffer.keyPressed(vt320.KEY_INSERT, ' ', getStateForBuffer()); @@ -595,6 +602,9 @@ if (PreferenceConstants.HWBUTTON_SCREEN_CAPTURE.equals(shortcut)) { bridge.captureScreen(); } + else if (PreferenceConstants.HWBUTTON_MONITOR.equals(shortcut)) { + buffer.monitorKey(true); // key down + } else if (PreferenceConstants.HWBUTTON_CTRL.equals(shortcut)) { showMetakeyToast(v, PreferenceConstants.HWBUTTON_CTRL); metaPress(META_CTRL_ON);