Skip to content

Commit

Permalink
Remove unused virtual mouse
Browse files Browse the repository at this point in the history
  • Loading branch information
rom1v authored and Gottox committed Sep 29, 2024
1 parent 6e4cfaa commit f41fdd4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 0 additions & 2 deletions app/src/control_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ get_well_known_pointer_id_name(uint64_t pointer_id) {
return "mouse";
case SC_POINTER_ID_GENERIC_FINGER:
return "finger";
case SC_POINTER_ID_VIRTUAL_MOUSE:
return "vmouse";
case SC_POINTER_ID_VIRTUAL_FINGER:
return "vfinger";
default:
Expand Down
3 changes: 1 addition & 2 deletions app/src/control_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
#define SC_POINTER_ID_GENERIC_FINGER UINT64_C(-2)

// Used for injecting an additional virtual pointer for pinch-to-zoom
#define SC_POINTER_ID_VIRTUAL_MOUSE UINT64_C(-3)
#define SC_POINTER_ID_VIRTUAL_FINGER UINT64_C(-4)
#define SC_POINTER_ID_VIRTUAL_FINGER UINT64_C(-3)

enum sc_control_msg_type {
SC_CONTROL_MSG_TYPE_INJECT_KEYCODE,
Expand Down
5 changes: 2 additions & 3 deletions server/src/main/java/com/genymobile/scrcpy/Controller.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public class Controller implements AsyncProcessor {

// control_msg.h values of the pointerId field in inject_touch_event message
private static final int POINTER_ID_MOUSE = -1;
private static final int POINTER_ID_VIRTUAL_MOUSE = -3;

private static final ScheduledExecutorService EXECUTOR = Executors.newSingleThreadScheduledExecutor();

Expand Down Expand Up @@ -273,8 +272,8 @@ private boolean injectTouch(int action, long pointerId, Position position, float
pointer.setPressure(pressure);

int source;
if (pointerId == POINTER_ID_MOUSE || pointerId == POINTER_ID_VIRTUAL_MOUSE) {
// real mouse event (forced by the client when --forward-on-click)
if (pointerId == POINTER_ID_MOUSE) {
// real mouse event
pointerProperties[pointerIndex].toolType = MotionEvent.TOOL_TYPE_MOUSE;
source = InputDevice.SOURCE_MOUSE;
pointer.setUp(buttons == 0);
Expand Down

0 comments on commit f41fdd4

Please sign in to comment.