Closed Bug 1318586 Opened 8 years ago Closed 8 years ago

[webvr] Adjust OpenVR controller button mapping

Categories

(Core :: Graphics, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla53
Tracking Status
firefox53 --- fixed

People

(Reporter: daoshengmu, Assigned: daoshengmu)

Details

Attachments

(1 file)

Our current button mapping follows OpenVR sdk. But, it is not mapped to other WebVR projects, like https://github.com/aframevr/aframe/blob/03139adbc3567b7116fc4f8b92d6aae6794d97a2/src/components/vive-controls.js#L32. Chromium is also do the same thing, https://chromium.googlesource.com/experimental/chromium/src/+/60e635ba381f28aeb880fe737e003af4b47b1aa7/device/vr/openvr/open_vr_gamepad_data_fetcher.cc#115.

Our current implementation follows OpenVR's header, https://github.com/ValveSoftware/openvr/blob/5bc41e4b55d11dfc8fb4b958a6600aa7f8cee051/headers/openvr.h#L540. One thing we could enhance is checking SupportedButtons property for different devices' button support.
uint64_t supported_buttons = vr_system_->GetUint64TrackedDeviceProperty(deviceId, vr::Prop_SupportedButtons_Uint64);
Assignee: nobody → dmu
After discussing with MozVR team, we hope to make the button mapping to be consistency with the current WebVR projects in this short term. https://github.com/aframevr/aframe/blob/03139adbc3567b7116fc4f8b92d6aae6794d97a2/src/components/vive-controls.js#L32.

And we will keep discussing with other implementers to finalize the decision about the mapping.
Because Kip's back, I change the r? to kip.
gw280, thanks for your help.
Comment on attachment 8812107 [details]
Bug 1318586 - Adjust OpenVR controller button mapping to be consistency;

https://reviewboard.mozilla.org/r/93992/#review95374

This looks good to me.  r=me with a small comment to warn people that changing the order of the buttons could break web content

::: gfx/vr/gfxVROpenVR.cpp:64
(Diff revision 2)
>  static pfn_VR_GetGenericInterface vr_GetGenericInterface = nullptr;
>  
>  // EButton_System, EButton_DPad_xx, and EButton_A
>  // can not be triggered in Steam Vive in OpenVR SDK 1.0.3.
>  const uint64_t gOpenVRButtonMask[] = {
>    // vr::ButtonMaskFromId(vr::EVRButtonId::k_EButton_System),

Perhaps a short comment here stating that changing the order of these buttons may break web content could be useful.
Attachment #8812107 - Flags: review?(kgilbert) → review+
Keywords: checkin-needed
Pushed by cbook@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/809655f44e19
Adjust OpenVR controller button mapping to be consistency; r=kip
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/809655f44e19
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: