aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/main/java/org/connectbot/TerminalView.java
diff options
context:
space:
mode:
authorRyan Hansberry <rhansby@gmail.com>2015-10-05 11:09:24 -0700
committerRyan Hansberry <rhansby@gmail.com>2015-10-07 10:28:29 -0700
commit2c2a604517d57390c22928c60fdf557ebc68dc5c (patch)
tree0792f376fdd48ce12b98e828249bbc865f356c26 /app/src/main/java/org/connectbot/TerminalView.java
parentf93f415b77fd777bccbac6c73f2aecfe01464fb8 (diff)
downloadconnectbot-2c2a604517d57390c22928c60fdf557ebc68dc5c.tar.gz
connectbot-2c2a604517d57390c22928c60fdf557ebc68dc5c.tar.bz2
connectbot-2c2a604517d57390c22928c60fdf557ebc68dc5c.zip
Cleanup.
Diffstat (limited to 'app/src/main/java/org/connectbot/TerminalView.java')
-rw-r--r--app/src/main/java/org/connectbot/TerminalView.java25
1 files changed, 19 insertions, 6 deletions
diff --git a/app/src/main/java/org/connectbot/TerminalView.java b/app/src/main/java/org/connectbot/TerminalView.java
index 6d051f6..9167366 100644
--- a/app/src/main/java/org/connectbot/TerminalView.java
+++ b/app/src/main/java/org/connectbot/TerminalView.java
@@ -26,8 +26,8 @@ import org.connectbot.service.FontSizeChangedListener;
import org.connectbot.service.TerminalBridge;
import org.connectbot.service.TerminalKeyListener;
-import android.annotation.TargetApi;
import android.annotation.SuppressLint;
+import android.annotation.TargetApi;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
@@ -391,7 +391,20 @@ public class TerminalView extends TextView implements FontSizeChangedListener {
case MotionEvent.ACTION_SCROLL:
// Process scroll wheel movement:
float yDistance = MotionEventCompat.getAxisValue(event, MotionEvent.AXIS_VSCROLL);
- if (yDistance != 0) {
+ boolean mouseReport = ((vt320) bridge.buffer).isMouseReportEnabled();
+ if (mouseReport) {
+ int row = (int) Math.floor(event.getY() / bridge.charHeight);
+ int col = (int) Math.floor(event.getX() / bridge.charWidth);
+
+ ((vt320) bridge.buffer).mouseWheel(
+ yDistance > 0,
+ col,
+ row,
+ (event.getMetaState() & KeyEvent.META_CTRL_ON) != 0,
+ (event.getMetaState() & KeyEvent.META_SHIFT_ON) != 0,
+ (event.getMetaState() & KeyEvent.META_META_ON) != 0);
+ return true;
+ } else if (yDistance != 0) {
int base = bridge.buffer.getWindowBase();
bridge.buffer.setWindowBase(base - Math.round(yDistance));
return true;
@@ -530,10 +543,10 @@ public class TerminalView extends TextView implements FontSizeChangedListener {
SelectionArea area = bridge.getSelectionArea();
canvas.save(Canvas.CLIP_SAVE_FLAG);
canvas.clipRect(
- area.getLeft() * bridge.charWidth,
- area.getTop() * bridge.charHeight,
- (area.getRight() + 1) * bridge.charWidth,
- (area.getBottom() + 1) * bridge.charHeight
+ area.getLeft() * bridge.charWidth,
+ area.getTop() * bridge.charHeight,
+ (area.getRight() + 1) * bridge.charWidth,
+ (area.getBottom() + 1) * bridge.charHeight
);
canvas.drawPaint(cursorPaint);
canvas.restore();