Mercurial > 510Connectbot
diff src/com/five_ten_sg/connectbot/service/TerminalKeyListener.java @ 307:071eccdff8ea ganymed
fix java formatting
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Wed, 30 Jul 2014 14:16:58 -0700 |
parents | f9b1a07c0e96 |
children | 208b31032318 |
line wrap: on
line diff
--- a/src/com/five_ten_sg/connectbot/service/TerminalKeyListener.java Wed Jul 30 12:09:51 2014 -0700 +++ b/src/com/five_ten_sg/connectbot/service/TerminalKeyListener.java Wed Jul 30 14:16:58 2014 -0700 @@ -569,40 +569,41 @@ private boolean handleShortcuts(View v, int keyCode, KeyEvent event, int repeat, boolean down) { String hwbuttonShortcut; + switch (keyCode) { case KeyEvent.KEYCODE_CAMERA: // check to see which shortcut the camera button triggers hwbuttonShortcut = manager.prefs.getString( - PreferenceConstants.CAMERA, - PreferenceConstants.HWBUTTON_SCREEN_CAPTURE); + PreferenceConstants.CAMERA, + PreferenceConstants.HWBUTTON_SCREEN_CAPTURE); return (handleShortcut(v, hwbuttonShortcut, repeat, down)); case KeyEvent.KEYCODE_VOLUME_UP: // check to see which shortcut the volume button triggers hwbuttonShortcut = manager.prefs.getString( - PreferenceConstants.VOLUP, - PreferenceConstants.HWBUTTON_FUNCTION_KEYS); + PreferenceConstants.VOLUP, + PreferenceConstants.HWBUTTON_FUNCTION_KEYS); return (handleShortcut(v, hwbuttonShortcut, repeat, down)); case KeyEvent.KEYCODE_VOLUME_DOWN: // check to see which shortcut the camera button triggers hwbuttonShortcut = manager.prefs.getString( - PreferenceConstants.VOLDN, - PreferenceConstants.HWBUTTON_TAB); + PreferenceConstants.VOLDN, + PreferenceConstants.HWBUTTON_TAB); return (handleShortcut(v, hwbuttonShortcut, repeat, down)); case KeyEvent.KEYCODE_SEARCH: // check to see which shortcut the search button triggers hwbuttonShortcut = manager.prefs.getString( - PreferenceConstants.SEARCH, - PreferenceConstants.HWBUTTON_ESC); + PreferenceConstants.SEARCH, + PreferenceConstants.HWBUTTON_ESC); return (handleShortcut(v, hwbuttonShortcut, repeat, down)); case KeyEvent.KEYCODE_BUTTON_L2: // check to see which shortcut the ptt button triggers hwbuttonShortcut = manager.prefs.getString( - PreferenceConstants.PTT, - PreferenceConstants.HWBUTTON_MONITOR); + PreferenceConstants.PTT, + PreferenceConstants.HWBUTTON_MONITOR); return (handleShortcut(v, hwbuttonShortcut, repeat, down)); default: return false; @@ -612,51 +613,64 @@ private boolean handleShortcut(View v, String shortcut, int repeat, boolean down) { if (PreferenceConstants.HWBUTTON_DECREASE_FONTSIZE.equals(shortcut)) { if (!down) return false; + bridge.decreaseFontSize(); } else if (PreferenceConstants.HWBUTTON_INCREASE_FONTSIZE.equals(shortcut)) { if (!down) return false; + bridge.increaseFontSize(); } else if (PreferenceConstants.HWBUTTON_FUNCTION_KEYS.equals(shortcut)) { if (repeat > 0) return false; + if (!down) return false; + bridge.showFKeysDialog(); } else if (PreferenceConstants.HWBUTTON_MONITOR.equals(shortcut)) { if (repeat > 0) return false; + buffer.monitorKey(down); } else if (PreferenceConstants.HWBUTTON_SCREEN_CAPTURE.equals(shortcut)) { if (repeat > 0) return false; + if (!down) return false; + bridge.captureScreen(); } else if (PreferenceConstants.HWBUTTON_CTRL.equals(shortcut)) { if (!down) return false; + showMetakeyToast(v, PreferenceConstants.HWBUTTON_CTRL); metaPress(META_CTRL_ON); } else if (PreferenceConstants.HWBUTTON_TAB.equals(shortcut)) { if (!down) return false; + buffer.keyPressed(vt320.KEY_TAB, ' ', getStateForBuffer()); } else if (PreferenceConstants.HWBUTTON_CTRLA_SPACE.equals(shortcut)) { if (!down) return false; + buffer.write(0x01); buffer.write(' '); } else if (PreferenceConstants.HWBUTTON_CTRLA.equals(shortcut)) { if (!down) return false; + buffer.write(0x01); } else if (PreferenceConstants.HWBUTTON_ESC.equals(shortcut)) { if (!down) return false; + showMetakeyToast(v, PreferenceConstants.HWBUTTON_ESC); sendEscape(); } else if (PreferenceConstants.HWBUTTON_ESC_A.equals(shortcut)) { if (!down) return false; + sendEscape(); buffer.write('a'); }