mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-08-10 00:52:16 +00:00
Implement controller arrival metadata support
This commit is contained in:
@@ -770,8 +770,15 @@ namespace platf {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Creates a new virtual gamepad.
|
||||
* @param nr The assigned controller number.
|
||||
* @param metadata Controller metadata from client (empty if none provided).
|
||||
* @param rumble_queue The queue for posting rumble messages to the client.
|
||||
* @return 0 on success.
|
||||
*/
|
||||
int
|
||||
alloc_gamepad(int nr, rumble_queue_t &&rumble_queue) {
|
||||
alloc_gamepad(int nr, const gamepad_arrival_t &metadata, rumble_queue_t &&rumble_queue) {
|
||||
TUPLE_2D_REF(input, gamepad_state, gamepads[nr]);
|
||||
|
||||
int err = libevdev_uinput_create_from_device(gamepad_dev.get(), LIBEVDEV_UINPUT_OPEN_MANAGED, &input);
|
||||
@@ -1480,9 +1487,17 @@ namespace platf {
|
||||
keyboard_ev(kb, KEY_LEFTCTRL, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Creates a new virtual gamepad.
|
||||
* @param input The input context.
|
||||
* @param nr The assigned controller number.
|
||||
* @param metadata Controller metadata from client (empty if none provided).
|
||||
* @param rumble_queue The queue for posting rumble messages to the client.
|
||||
* @return 0 on success.
|
||||
*/
|
||||
int
|
||||
alloc_gamepad(input_t &input, int nr, rumble_queue_t rumble_queue) {
|
||||
return ((input_raw_t *) input.get())->alloc_gamepad(nr, std::move(rumble_queue));
|
||||
alloc_gamepad(input_t &input, int nr, const gamepad_arrival_t &metadata, rumble_queue_t rumble_queue) {
|
||||
return ((input_raw_t *) input.get())->alloc_gamepad(nr, metadata, std::move(rumble_queue));
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user