Skip to content

Commit c7dc2dc

Browse files
committed
send scroll codes
1 parent 7c1d6aa commit c7dc2dc

File tree

2 files changed

+27
-9
lines changed

2 files changed

+27
-9
lines changed

libraries/emulatorview/src/jackpal/androidterm/emulatorview/EmulatorView.java

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -829,9 +829,19 @@ public void setUseCookedIME(boolean useCookedIME) {
829829
// Begin GestureDetector.OnGestureListener methods
830830

831831
public boolean onSingleTapUp(MotionEvent e) {
832-
if (mExtGestureListener != null && mExtGestureListener.onSingleTapUp(e)) {
833-
return true;
834-
}
832+
//if (mExtGestureListener != null && mExtGestureListener.onSingleTapUp(e)) {
833+
// return true;
834+
//}
835+
836+
byte[] data = new byte[6];
837+
data[0] = '\033';
838+
data[1] = '[';
839+
data[2] = 'M';
840+
data[3] = 32;
841+
data[4] = (byte)(32 + e.getX() / mCharacterWidth);
842+
data[5] = (byte)(32 + e.getY() / mCharacterHeight);
843+
mTermSession.write(data, 0, 6);
844+
835845
requestFocus();
836846
return true;
837847
}
@@ -849,10 +859,18 @@ public boolean onScroll(MotionEvent e1, MotionEvent e2,
849859
distanceY += mScrollRemainder;
850860
int deltaRows = (int) (distanceY / mCharacterHeight);
851861
mScrollRemainder = distanceY - deltaRows * mCharacterHeight;
852-
mTopRow =
853-
Math.min(0, Math.max(-(mTranscriptScreen
854-
.getActiveTranscriptRows()), mTopRow + deltaRows));
855-
invalidate();
862+
863+
for(; deltaRows>0; deltaRows--) {
864+
mTermSession.write("\033[M\141\000\000");
865+
}
866+
for(; deltaRows<0; deltaRows++) {
867+
mTermSession.write("\033[M\140\000\000");
868+
}
869+
870+
//mTopRow =
871+
// Math.min(0, Math.max(-(mTranscriptScreen
872+
// .getActiveTranscriptRows()), mTopRow + deltaRows));
873+
//invalidate();
856874

857875
return true;
858876
}

tools/pushAndRun

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ fi
1414

1515
ADB="$ANDROID_SDK_ROOT/platform-tools/adb"
1616

17-
$ADB uninstall jackpal.androidterm
18-
$ADB install -r bin/Term.apk && adb shell am start -n jackpal.androidterm/jackpal.androidterm.Term
17+
#$ADB uninstall jackpal.androidterm
18+
$ADB install -r bin/Term-debug.apk && adb shell am start -n jackpal.androidterm/jackpal.androidterm.Term

0 commit comments

Comments
 (0)