mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-04-21 01:33:36 +00:00
Instead of using separate hardcoded keys for mouse capture/uncapture, use the shortcut mods. By changing the shortcut mods (for example --shortcut-mod=rctrl), it allows to forward Alt and Super to the device. Fixes #5318 <https://github.com/Genymobile/scrcpy/issues/5318> PR #5322 <https://github.com/Genymobile/scrcpy/pull/5322>
51 lines
1.2 KiB
C
51 lines
1.2 KiB
C
#ifndef SC_SCREEN_OTG_H
|
|
#define SC_SCREEN_OTG_H
|
|
|
|
#include "common.h"
|
|
|
|
#include <stdbool.h>
|
|
#include <SDL2/SDL.h>
|
|
|
|
#include "keyboard_aoa.h"
|
|
#include "mouse_aoa.h"
|
|
#include "mouse_capture.h"
|
|
#include "gamepad_aoa.h"
|
|
|
|
struct sc_screen_otg {
|
|
struct sc_keyboard_aoa *keyboard;
|
|
struct sc_mouse_aoa *mouse;
|
|
struct sc_gamepad_aoa *gamepad;
|
|
|
|
SDL_Window *window;
|
|
SDL_Renderer *renderer;
|
|
SDL_Texture *texture;
|
|
|
|
struct sc_mouse_capture mc;
|
|
};
|
|
|
|
struct sc_screen_otg_params {
|
|
struct sc_keyboard_aoa *keyboard;
|
|
struct sc_mouse_aoa *mouse;
|
|
struct sc_gamepad_aoa *gamepad;
|
|
|
|
const char *window_title;
|
|
bool always_on_top;
|
|
int16_t window_x; // accepts SC_WINDOW_POSITION_UNDEFINED
|
|
int16_t window_y; // accepts SC_WINDOW_POSITION_UNDEFINED
|
|
uint16_t window_width;
|
|
uint16_t window_height;
|
|
bool window_borderless;
|
|
uint8_t shortcut_mods; // OR of enum sc_shortcut_mod values
|
|
};
|
|
|
|
bool
|
|
sc_screen_otg_init(struct sc_screen_otg *screen,
|
|
const struct sc_screen_otg_params *params);
|
|
|
|
void
|
|
sc_screen_otg_destroy(struct sc_screen_otg *screen);
|
|
|
|
void
|
|
sc_screen_otg_handle_event(struct sc_screen_otg *screen, SDL_Event *event);
|
|
|
|
#endif
|