Skip to content

Commit

Permalink
Allow dragging with middle button
Browse files Browse the repository at this point in the history
  • Loading branch information
gujjwal00 committed May 22, 2023
1 parent 1aedcb6 commit 37b4df9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/src/main/java/com/gaurav/avnc/ui/vnc/Dispatcher.kt
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ class Dispatcher(private val activity: VncActivity) {
"move-pointer" -> { _, cp, dx, dy -> defaultMode.doMovePointer(cp, dx, dy) }
"remote-scroll" -> { sp, _, dx, dy -> defaultMode.doRemoteScroll(sp, dx, dy) }
"remote-drag" -> { _, cp, dx, dy -> defaultMode.doRemoteDrag(PointerButton.Left, cp, dx, dy) }
"remote-drag-middle" -> { _, cp, dx, dy -> defaultMode.doRemoteDrag(PointerButton.Middle, cp, dx, dy) }
else -> { _, _, _, _ -> } //Nothing
}
}
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/values/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,25 +112,29 @@
<string-array name="double_tap_swipe_action_entries">
<item>@string/pref_gesture_action_none</item>
<item>@string/pref_gesture_action_remote_drag</item>
<item>@string/pref_gesture_action_remote_drag_middle</item>
<item>@string/pref_gesture_action_pan</item>
<item>@string/pref_gesture_action_remote_scroll</item>
</string-array>
<string-array name="double_tap_swipe_action_values">
<item>none</item>
<item>remote-drag</item>
<item>remote-drag-middle</item>
<item>pan</item>
<item>remote-scroll</item>
</string-array>

<string-array name="long_press_swipe_action_entries">
<item>@string/pref_gesture_action_none</item>
<item>@string/pref_gesture_action_remote_drag</item>
<item>@string/pref_gesture_action_remote_drag_middle</item>
<item>@string/pref_gesture_action_pan</item>
<item>@string/pref_gesture_action_remote_scroll</item>
</string-array>
<string-array name="long_press_swipe_action_values">
<item>none</item>
<item>remote-drag</item>
<item>remote-drag-middle</item>
<item>pan</item>
<item>remote-scroll</item>
</string-array>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
<string name="pref_gesture_action_pan">Pan local frame</string>
<string name="pref_gesture_action_remote_scroll">Scroll remote content</string>
<string name="pref_gesture_action_remote_drag">Drag remote content</string>
<string name="pref_gesture_action_remote_drag_middle">Drag with middle button</string>
<string name="pref_gesture_action_open_keyboard">Open keyboard</string>

<string name="pref_theme">Theme</string>
Expand Down

0 comments on commit 37b4df9

Please sign in to comment.