mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-04-21 01:33:36 +00:00
Use scrcpy input events for mouse processors
Pass scrcpy input events instead of SDL input events to mouse processors. These events represent exactly what mouse processors need, abstracted from any visual orientation and scaling applied on the SDL window. This makes the mouse processors independent of the "screen" instance, and the implementation source code independent of the SDL API.
This commit is contained in:
parent
c0cb944c94
commit
8fcc5e9e4e
5 changed files with 169 additions and 104 deletions
|
|
@ -6,7 +6,7 @@
|
|||
#include <assert.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <SDL2/SDL_events.h>
|
||||
#include "input_events.h"
|
||||
|
||||
/**
|
||||
* Mouse processor trait.
|
||||
|
|
@ -21,19 +21,19 @@ struct sc_mouse_processor {
|
|||
struct sc_mouse_processor_ops {
|
||||
void
|
||||
(*process_mouse_motion)(struct sc_mouse_processor *mp,
|
||||
const SDL_MouseMotionEvent *event);
|
||||
const struct sc_mouse_motion_event *event);
|
||||
|
||||
void
|
||||
(*process_touch)(struct sc_mouse_processor *mp,
|
||||
const SDL_TouchFingerEvent *event);
|
||||
const struct sc_touch_event *event);
|
||||
|
||||
void
|
||||
(*process_mouse_button)(struct sc_mouse_processor *mp,
|
||||
const SDL_MouseButtonEvent *event);
|
||||
(*process_mouse_click)(struct sc_mouse_processor *mp,
|
||||
const struct sc_mouse_click_event *event);
|
||||
|
||||
void
|
||||
(*process_mouse_wheel)(struct sc_mouse_processor *mp,
|
||||
const SDL_MouseWheelEvent *event);
|
||||
(*process_mouse_scroll)(struct sc_mouse_processor *mp,
|
||||
const struct sc_mouse_scroll_event *event);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue