@@ -47,6 +47,9 @@ public final class TerminalView extends View {
47
47
/** Log terminal view key and IME events. */
48
48
private static boolean TERMINAL_VIEW_KEY_LOGGING_ENABLED = false ;
49
49
50
+ /** Send full mouse events for dragging the touch screen, rather than scroll-wheep up/down */
51
+ private static boolean ADVANCED_MOUSE = false ;
52
+
50
53
/** The currently displayed terminal session, whose emulator is {@link #mEmulator}. */
51
54
public TerminalSession mTermSession ;
52
55
/** Our terminal emulator whose session is {@link #mTermSession}. */
@@ -85,7 +88,7 @@ public final class TerminalView extends View {
85
88
/** If non-zero, this is the last unicode code point received if that was a combining character. */
86
89
int mCombiningAccent ;
87
90
88
- private final boolean mAccessibilityEnabled ;
91
+ private final boolean mAccessibilityEnabled ;;
89
92
90
93
/** The {@link KeyEvent} is generated from a virtual keyboard, like manually with the {@link KeyEvent#KeyEvent(int, int)} constructor. */
91
94
public final static int KEY_EVENT_SOURCE_VIRTUAL_KEYBOARD = KeyCharacterMap .VIRTUAL_KEYBOARD ; // -1
@@ -131,7 +134,8 @@ public boolean onSingleTapUp(MotionEvent event) {
131
134
@ Override
132
135
public boolean onScroll (MotionEvent e , float distanceX , float distanceY ) {
133
136
if (mEmulator == null ) return true ;
134
- if (mEmulator .isMouseTrackingActive () && e .isFromSource (InputDevice .SOURCE_MOUSE )) {
137
+ if (ADVANCED_MOUSE || (mEmulator .isMouseTrackingActive () && e .isFromSource (InputDevice .SOURCE_MOUSE ))) {
138
+ // Unless using advanced mouse mode:
135
139
// If moving with mouse pointer while pressing button, report that instead of scroll.
136
140
// This means that we never report moving with button press-events for touch input,
137
141
// since we cannot just start sending these events without a starting press event,
@@ -242,6 +246,15 @@ public void setIsTerminalViewKeyLoggingEnabled(boolean value) {
242
246
TERMINAL_VIEW_KEY_LOGGING_ENABLED = value ;
243
247
}
244
248
249
+ /**
250
+ * Sets whether dragging the touch screen sends mouse move events, or up/down scroll wheel
251
+ *
252
+ * @param value True to send mouse swipe events, false for scroll wheel
253
+ */
254
+ public void setAdvancedMouse (boolean value ) {
255
+ ADVANCED_MOUSE = value ;
256
+ }
257
+
245
258
246
259
247
260
/**
0 commit comments