Log gamepad added/removed
Add a log when a gamepad is added or removed. PR #5623 <https://github.com/Genymobile/scrcpy/pull/5623>
This commit is contained in:
parent
7418fd0662
commit
328bb74f80
@ -69,6 +69,12 @@ sc_gamepad_processor_process_gamepad_added(struct sc_gamepad_processor *gp,
|
||||
return;
|
||||
}
|
||||
|
||||
SDL_GameController* game_controller =
|
||||
SDL_GameControllerFromInstanceID(event->gamepad_id);
|
||||
assert(game_controller);
|
||||
const char *name = SDL_GameControllerName(game_controller);
|
||||
LOGI("Gamepad added: [%" PRIu32 "] %s", event->gamepad_id, name);
|
||||
|
||||
sc_gamepad_uhid_send_open(gamepad, &hid_open);
|
||||
}
|
||||
|
||||
@ -83,6 +89,8 @@ sc_gamepad_processor_process_gamepad_removed(struct sc_gamepad_processor *gp,
|
||||
return;
|
||||
}
|
||||
|
||||
LOGI("Gamepad removed: [%" PRIu32 "]", event->gamepad_id);
|
||||
|
||||
sc_gamepad_uhid_send_close(gamepad, &hid_close);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user