mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-04-21 01:33:36 +00:00
Initialize controller before keyboards
The UHID keyboard initializer will need the controller.
This commit is contained in:
parent
56fdc01fd2
commit
cbd3289db0
1 changed files with 12 additions and 12 deletions
|
|
@ -542,6 +542,18 @@ scrcpy(struct scrcpy_options *options) {
|
|||
struct sc_mouse_processor *mp = NULL;
|
||||
|
||||
if (options->control) {
|
||||
if (!sc_controller_init(&s->controller, s->server.control_socket,
|
||||
acksync)) {
|
||||
goto end;
|
||||
}
|
||||
controller_initialized = true;
|
||||
|
||||
if (!sc_controller_start(&s->controller)) {
|
||||
goto end;
|
||||
}
|
||||
controller_started = true;
|
||||
controller = &s->controller;
|
||||
|
||||
#ifdef HAVE_USB
|
||||
bool use_keyboard_aoa =
|
||||
options->keyboard_input_mode == SC_KEYBOARD_INPUT_MODE_AOA;
|
||||
|
|
@ -662,18 +674,6 @@ aoa_hid_end:
|
|||
sc_mouse_sdk_init(&s->mouse_sdk, &s->controller);
|
||||
mp = &s->mouse_sdk.mouse_processor;
|
||||
}
|
||||
|
||||
if (!sc_controller_init(&s->controller, s->server.control_socket,
|
||||
acksync)) {
|
||||
goto end;
|
||||
}
|
||||
controller_initialized = true;
|
||||
|
||||
if (!sc_controller_start(&s->controller)) {
|
||||
goto end;
|
||||
}
|
||||
controller_started = true;
|
||||
controller = &s->controller;
|
||||
}
|
||||
|
||||
// There is a controller if and only if control is enabled
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue