@@ -281,80 +281,106 @@ namespace virtualdesktop_openxr {
281281 if (path == " /user/hand/left/input/x/click" || path == " /user/hand/left/input/x" ) {
282282 source.buttonMap = &m_cachedInputState.Buttons ;
283283 source.buttonType = ovrButton_X;
284+ source.sourceIndex = ActionSourceIndex::X;
284285 } else if (path == " /user/hand/left/input/x/touch" ) {
285286 source.buttonMap = &m_cachedInputState.Touches ;
286287 source.buttonType = (ovrButton)ovrTouch_X;
288+ source.sourceIndex = ActionSourceIndex::XTouch;
287289 } else if (path == " /user/hand/left/input/y/click" || path == " /user/hand/left/input/y" ) {
288290 source.buttonMap = &m_cachedInputState.Buttons ;
289291 source.buttonType = ovrButton_Y;
292+ source.sourceIndex = ActionSourceIndex::Y;
290293 } else if (path == " /user/hand/left/input/y/touch" ) {
291294 source.buttonMap = &m_cachedInputState.Touches ;
292295 source.buttonType = (ovrButton)ovrTouch_Y;
296+ source.sourceIndex = ActionSourceIndex::YTouch;
293297 } else if (path == " /user/hand/left/input/menu/click" || path == " /user/hand/left/menu" ) {
294298 source.buttonMap = &m_cachedInputState.Buttons ;
295299 source.buttonType = ovrButton_Enter;
300+ source.sourceIndex = ActionSourceIndex::Menu;
296301 } else if (path == " /user/hand/right/input/a/click" || path == " /user/hand/right/input/a" ) {
297302 source.buttonMap = &m_cachedInputState.Buttons ;
298303 source.buttonType = ovrButton_A;
304+ source.sourceIndex = ActionSourceIndex::A;
299305 } else if (path == " /user/hand/right/input/a/touch" ) {
300306 source.buttonMap = &m_cachedInputState.Touches ;
301307 source.buttonType = (ovrButton)ovrTouch_A;
308+ source.sourceIndex = ActionSourceIndex::ATouch;
302309 } else if (path == " /user/hand/right/input/b/click" || path == " /user/hand/right/input/b" ) {
303310 source.buttonMap = &m_cachedInputState.Buttons ;
304311 source.buttonType = ovrButton_B;
312+ source.sourceIndex = ActionSourceIndex::B;
305313 } else if (path == " /user/hand/right/input/b/touch" ) {
306314 source.buttonMap = &m_cachedInputState.Touches ;
307315 source.buttonType = (ovrButton)ovrTouch_B;
316+ source.sourceIndex = ActionSourceIndex::BTouch;
308317 } else if (path == " /user/hand/right/input/system/click" || path == " /user/hand/right/input/system" ) {
309318 source.buttonMap = &m_cachedInputState.Buttons ;
310319 source.buttonType = ovrButton_Home;
311320 } else if (endsWith (path, " /input/squeeze/click" ) || endsWith (path, " /input/squeeze/value" ) ||
312321 endsWith (path, " /input/squeeze" )) {
313322 source.floatValue = m_cachedInputState.HandTrigger ;
323+ source.sourceIndex = ActionSourceIndex::Squeeze;
314324 } else if (endsWith (path, " /input/squeeze/force" )) {
315325 source.floatValue = m_cachedInputState.HandTrigger ;
326+ source.sourceIndex = ActionSourceIndex::Squeeze;
316327 } else if (endsWith (path, " /input/trigger/click" ) || endsWith (path, " /input/trigger/value" ) ||
317328 endsWith (path, " /input/trigger" )) {
318329 source.floatValue = m_cachedInputState.IndexTrigger ;
330+ source.sourceIndex = ActionSourceIndex::Trigger;
319331 } else if (path == " /user/hand/left/input/trigger/touch" ) {
320332 source.buttonMap = &m_cachedInputState.Touches ;
321333 source.buttonType = (ovrButton)ovrTouch_LIndexTrigger;
334+ source.sourceIndex = ActionSourceIndex::TriggerTouch;
322335 } else if (path == " /user/hand/right/input/trigger/touch" ) {
323336 source.buttonMap = &m_cachedInputState.Touches ;
324337 source.buttonType = (ovrButton)ovrTouch_RIndexTrigger;
338+ source.sourceIndex = ActionSourceIndex::TriggerTouch;
325339 } else if (path == " /user/hand/left/input/thumbstick/click" ||
326340 (xrAction.type == XR_ACTION_TYPE_BOOLEAN_INPUT && path == " /user/hand/left/input/thumbstick" )) {
327341 source.buttonMap = &m_cachedInputState.Buttons ;
328342 source.buttonType = ovrButton_LThumb;
343+ source.sourceIndex = ActionSourceIndex::Thumbstick;
329344 } else if (path == " /user/hand/right/input/thumbstick/click" ||
330345 (xrAction.type == XR_ACTION_TYPE_BOOLEAN_INPUT && path == " /user/hand/right/input/thumbstick" )) {
331346 source.buttonMap = &m_cachedInputState.Buttons ;
332347 source.buttonType = ovrButton_RThumb;
348+ source.sourceIndex = ActionSourceIndex::Thumbstick;
333349 } else if (endsWith (path, " /input/thumbstick" )) {
334350 source.vector2fValue = m_cachedInputState.ThumbstickNoDeadzone ;
335351 source.vector2fIndex = -1 ;
352+ source.sourceIndex = ActionSourceIndex::ThumbstickXY;
336353 } else if (endsWith (path, " /input/thumbstick/x" )) {
337354 source.vector2fValue = m_cachedInputState.ThumbstickNoDeadzone ;
338355 source.vector2fIndex = 0 ;
356+ source.sourceIndex = ActionSourceIndex::ThumbstickX;
339357 } else if (endsWith (path, " /input/thumbstick/y" )) {
340358 source.vector2fValue = m_cachedInputState.ThumbstickNoDeadzone ;
341359 source.vector2fIndex = 1 ;
360+ source.sourceIndex = ActionSourceIndex::ThumbstickY;
342361 } else if (path == " /user/hand/left/input/thumbstick/touch" ) {
343362 source.buttonMap = &m_cachedInputState.Touches ;
344363 source.buttonType = (ovrButton)ovrTouch_LThumb;
364+ source.sourceIndex = ActionSourceIndex::ThumbstickTouch;
345365 } else if (path == " /user/hand/right/input/thumbstick/touch" ) {
346366 source.buttonMap = &m_cachedInputState.Touches ;
347367 source.buttonType = (ovrButton)ovrTouch_RThumb;
368+ source.sourceIndex = ActionSourceIndex::ThumbstickTouch;
348369 } else if (path == " /user/hand/left/input/thumbrest/touch" || path == " /user/hand/left/input/thumbrest" ) {
349370 source.buttonMap = &m_cachedInputState.Touches ;
350371 source.buttonType = (ovrButton)ovrTouch_LThumbRest;
372+ source.sourceIndex = ActionSourceIndex::ThumbrestTouch;
351373 } else if (path == " /user/hand/right/input/thumbrest/touch" || path == " /user/hand/right/input/thumbrest" ) {
352374 source.buttonMap = &m_cachedInputState.Touches ;
353375 source.buttonType = (ovrButton)ovrTouch_RThumbRest;
354- } else if (endsWith (path, " /input/grip/pose" ) || endsWith (path, " /input/grip" ) ||
355- endsWith (path, " /input/aim/pose" ) || endsWith (path, " /input/aim" ) ||
356- endsWith (path, " /input/palm_ext/pose" ) || endsWith (path, " /input/palm_ext" ) ||
357- endsWith (path, " /output/haptic" )) {
376+ source.sourceIndex = ActionSourceIndex::ThumbrestTouch;
377+ } else if (endsWith (path, " /input/grip/pose" ) || endsWith (path, " /input/grip" )) {
378+ source.sourceIndex = ActionSourceIndex::Grip;
379+ } else if (endsWith (path, " /input/aim/pose" ) || endsWith (path, " /input/aim" )) {
380+ source.sourceIndex = ActionSourceIndex::Aim;
381+ } else if (endsWith (path, " /input/palm_ext/pose" ) || endsWith (path, " /input/palm_ext" )) {
382+ source.sourceIndex = ActionSourceIndex::Palm;
383+ } else if (endsWith (path, " /output/haptic" )) {
358384 // Do nothing.
359385 } else {
360386 // No possible binding.
0 commit comments