aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/main/java/org/connectbot/service
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/org/connectbot/service')
-rw-r--r--app/src/main/java/org/connectbot/service/TerminalBridge.java43
-rw-r--r--app/src/main/java/org/connectbot/service/TerminalKeyListener.java8
2 files changed, 39 insertions, 12 deletions
diff --git a/app/src/main/java/org/connectbot/service/TerminalBridge.java b/app/src/main/java/org/connectbot/service/TerminalBridge.java
index b9e29e8..a888cc3 100644
--- a/app/src/main/java/org/connectbot/service/TerminalBridge.java
+++ b/app/src/main/java/org/connectbot/service/TerminalBridge.java
@@ -341,6 +341,33 @@ public class TerminalBridge implements VDUDisplay {
}
/**
+ * Only intended for pre-Honeycomb devices.
+ */
+ public void setSelectingForCopy(boolean selectingForCopy) {
+ this.selectingForCopy = selectingForCopy;
+ }
+
+ /**
+ * Only intended for pre-Honeycomb devices.
+ */
+ public boolean isSelectingForCopy() {
+ return selectingForCopy;
+ }
+
+ /**
+ * Only intended for pre-Honeycomb devices.
+ */
+ public SelectionArea getSelectionArea() {
+ return selectionArea;
+ }
+
+ public void copyCurrentSelection() {
+ if (parent != null) {
+ parent.copyCurrentSelectionToClipboard();
+ }
+ }
+
+ /**
* Inject a specific string into this terminal. Used for post-login strings
* and pasting clipboard.
*/
@@ -482,18 +509,6 @@ public class TerminalBridge implements VDUDisplay {
}
}
- public void setSelectingForCopy(boolean selectingForCopy) {
- this.selectingForCopy = selectingForCopy;
- }
-
- public boolean isSelectingForCopy() {
- return selectingForCopy;
- }
-
- public SelectionArea getSelectionArea() {
- return selectionArea;
- }
-
public synchronized void tryKeyVibrate() {
manager.tryKeyVibrate();
}
@@ -538,6 +553,10 @@ public class TerminalBridge implements VDUDisplay {
forcedSize = false;
}
+ public float getFontSize() {
+ return fontSizeDp;
+ }
+
/**
* Add an {@link FontSizeChangedListener} to the list of listeners for this
* bridge.
diff --git a/app/src/main/java/org/connectbot/service/TerminalKeyListener.java b/app/src/main/java/org/connectbot/service/TerminalKeyListener.java
index 1b2ffe4..753fa86 100644
--- a/app/src/main/java/org/connectbot/service/TerminalKeyListener.java
+++ b/app/src/main/java/org/connectbot/service/TerminalKeyListener.java
@@ -299,6 +299,14 @@ public class TerminalKeyListener implements OnKeyListener, OnSharedPreferenceCha
return true;
}
+ // CTRL-SHIFT-C to copy.
+ if (keyCode == KeyEvent.KEYCODE_C
+ && (derivedMetaState & HC_META_CTRL_ON) != 0
+ && (derivedMetaState & KeyEvent.META_SHIFT_ON) != 0) {
+ bridge.copyCurrentSelection();
+ return true;
+ }
+
// CTRL-SHIFT-V to paste.
if (keyCode == KeyEvent.KEYCODE_V
&& (derivedMetaState & HC_META_CTRL_ON) != 0