Fix handling of gamepad feedback with multiple clients connected

We need to use the client-relative index rather than the global index
when sending feedback to the client.
This commit is contained in:
Cameron Gutman
2023-07-10 19:43:09 -05:00
parent 65b2e19b07
commit 50f353d183
5 changed files with 64 additions and 46 deletions

View File

@@ -291,13 +291,13 @@ const KeyCodeMap kKeyCodesMap[] = {
/**
* @brief Creates a new virtual gamepad.
* @param input The input context.
* @param nr The assigned controller number.
* @param id The gamepad ID.
* @param metadata Controller metadata from client (empty if none provided).
* @param feedback_queue The queue for posting messages back to the client.
* @return 0 on success.
*/
int
alloc_gamepad(input_t &input, int nr, const gamepad_arrival_t &metadata, feedback_queue_t feedback_queue) {
alloc_gamepad(input_t &input, const gamepad_id_t &id, const gamepad_arrival_t &metadata, feedback_queue_t feedback_queue) {
BOOST_LOG(info) << "alloc_gamepad: Gamepad not yet implemented for MacOS."sv;
return -1;
}