Skip to content

Commit

Permalink
Add missing SC_ prefix for pointer id constants
Browse files Browse the repository at this point in the history
  • Loading branch information
rom1v committed Jul 11, 2024
1 parent 6d98766 commit 0bce4d7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions app/src/control_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ static const char *const copy_key_labels[] = {
static inline const char *
get_well_known_pointer_id_name(uint64_t pointer_id) {
switch (pointer_id) {
case POINTER_ID_MOUSE:
case SC_POINTER_ID_MOUSE:
return "mouse";
case POINTER_ID_GENERIC_FINGER:
case SC_POINTER_ID_GENERIC_FINGER:
return "finger";
case POINTER_ID_VIRTUAL_MOUSE:
case SC_POINTER_ID_VIRTUAL_MOUSE:
return "vmouse";
case POINTER_ID_VIRTUAL_FINGER:
case SC_POINTER_ID_VIRTUAL_FINGER:
return "vfinger";
default:
return NULL;
Expand Down
8 changes: 4 additions & 4 deletions app/src/control_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
// type: 1 byte; sequence: 8 bytes; paste flag: 1 byte; length: 4 bytes
#define SC_CONTROL_MSG_CLIPBOARD_TEXT_MAX_LENGTH (SC_CONTROL_MSG_MAX_SIZE - 14)

#define POINTER_ID_MOUSE UINT64_C(-1)
#define POINTER_ID_GENERIC_FINGER UINT64_C(-2)
#define SC_POINTER_ID_MOUSE UINT64_C(-1)
#define SC_POINTER_ID_GENERIC_FINGER UINT64_C(-2)

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

enum sc_control_msg_type {
SC_CONTROL_MSG_TYPE_INJECT_KEYCODE,
Expand Down
12 changes: 6 additions & 6 deletions app/src/input_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,8 @@ simulate_virtual_finger(struct sc_input_manager *im,
msg.inject_touch_event.position.screen_size = im->screen->frame_size;
msg.inject_touch_event.position.point = point;
msg.inject_touch_event.pointer_id =
im->has_secondary_click ? POINTER_ID_VIRTUAL_MOUSE
: POINTER_ID_VIRTUAL_FINGER;
im->has_secondary_click ? SC_POINTER_ID_VIRTUAL_MOUSE
: SC_POINTER_ID_VIRTUAL_FINGER;
msg.inject_touch_event.pressure = up ? 0.0f : 1.0f;
msg.inject_touch_event.action_button = 0;
msg.inject_touch_event.buttons = 0;
Expand Down Expand Up @@ -662,8 +662,8 @@ sc_input_manager_process_mouse_motion(struct sc_input_manager *im,

struct sc_mouse_motion_event evt = {
.position = sc_input_manager_get_position(im, event->x, event->y),
.pointer_id = im->has_secondary_click ? POINTER_ID_MOUSE
: POINTER_ID_GENERIC_FINGER,
.pointer_id = im->has_secondary_click ? SC_POINTER_ID_MOUSE
: SC_POINTER_ID_GENERIC_FINGER,
.xrel = event->xrel,
.yrel = event->yrel,
.buttons_state =
Expand Down Expand Up @@ -817,8 +817,8 @@ sc_input_manager_process_mouse_button(struct sc_input_manager *im,
.position = sc_input_manager_get_position(im, event->x, event->y),
.action = sc_action_from_sdl_mousebutton_type(event->type),
.button = sc_mouse_button_from_sdl(event->button),
.pointer_id = im->has_secondary_click ? POINTER_ID_MOUSE
: POINTER_ID_GENERIC_FINGER,
.pointer_id = im->has_secondary_click ? SC_POINTER_ID_MOUSE
: SC_POINTER_ID_GENERIC_FINGER,
.buttons_state = sc_mouse_buttons_state_from_sdl(sdl_buttons_state,
&im->mouse_bindings),
};
Expand Down

0 comments on commit 0bce4d7

Please sign in to comment.