Add gamepad forwarding through OpenXR

Forward a gamepad paired to the headset to the server. Useful when the controller is in range of the headset but not the server, such as a DualSense paired to a Quest over Bluetooth.

The headset reads the gamepad through the OpenXR microsoft/xbox_controller profile and forwards it on the existing input rails: gamepad device ids in the inputs packet, plus a gamepad entry in the interaction profile array that signals connection and disconnection from the tracking thread.

The server exposes a native OpenXR gamepad at /user/gamepad, connected while the headset reports a gamepad interaction profile. This needs no permission and is always available.

Rumble is sent back to the headset and applied through OpenXR haptics.
This commit is contained in:
JR Lanteigne
2026-07-08 19:10:50 +02:00
committed by xytovl
parent 9935203cfb
commit aeecc857de
14 changed files with 580 additions and 103 deletions
+3
View File
@@ -757,6 +757,9 @@ void wivrn_controller::set_inputs(const from_headset::inputs & inputs, const clo
for (const auto & input: inputs.values)
{
// Gamepad inputs are handled by wivrn_gamepad
if (input.id >= device_id::GAMEPAD_MENU_CLICK)
continue;
int64_t last_change_time = input.last_change_time ? clock_offset.from_headset(input.last_change_time) : 0;
auto [index, type, device] = map_input(input.id);
if (device != device_type)