Skip to content

Commit c3c3657

Browse files
committed
Fixes: Button codes and OpenXR, Unity movement by HadesVR
1 parent fbe3ae9 commit c3c3657

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

OpenVR/samples/driver_arduinohmd/driver_arduinohmd.cpp

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,8 @@ int KeyNameToKeyCode(std::string KeyName) {
271271
else if (KeyName == "I") return 'I';
272272
else if (KeyName == "O") return 'O';
273273
else if (KeyName == "P") return 'P';
274-
else if (KeyName == "[") return '[';
275-
else if (KeyName == "]") return ']';
274+
else if (KeyName == "[") return 219;
275+
else if (KeyName == "]") return 221;
276276
else if (KeyName == "A") return 'A';
277277
else if (KeyName == "S") return 'S';
278278
else if (KeyName == "D") return 'D';
@@ -282,8 +282,8 @@ int KeyNameToKeyCode(std::string KeyName) {
282282
else if (KeyName == "J") return 'J';
283283
else if (KeyName == "K") return 'K';
284284
else if (KeyName == "L") return 'L';
285-
else if (KeyName == ";") return 186;
286-
else if (KeyName == "'") return 222;
285+
else if (KeyName == ":") return 186;
286+
else if (KeyName == "APOSTROPHE") return 222;
287287
else if (KeyName == "\\") return 220;
288288
else if (KeyName == "Z") return 'Z';
289289
else if (KeyName == "X") return 'X';
@@ -410,6 +410,24 @@ class CDeviceDriver : public vr::ITrackedDeviceServerDriver, public vr::IVRDispl
410410

411411
vr::VRProperties()->SetStringProperty( m_ulPropertyContainer, Prop_ModelNumber_String, m_sModelNumber.c_str() );
412412
vr::VRProperties()->SetStringProperty( m_ulPropertyContainer, Prop_RenderModelName_String, m_sModelNumber.c_str() );
413+
414+
vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, Prop_SerialNumber_String, m_sSerialNumber.c_str());
415+
vr::VRProperties()->SetBoolProperty(m_ulPropertyContainer, Prop_WillDriftInYaw_Bool, false);
416+
vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, Prop_ManufacturerName_String, "OpenVR-ArduinoHMD");
417+
vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, Prop_TrackingFirmwareVersion_String, "1.0");
418+
vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, Prop_HardwareRevision_String, "1.0");
419+
vr::VRProperties()->SetBoolProperty(m_ulPropertyContainer, Prop_DeviceIsWireless_Bool, false);
420+
vr::VRProperties()->SetBoolProperty(m_ulPropertyContainer, Prop_DeviceIsCharging_Bool, false);
421+
vr::VRProperties()->SetBoolProperty(m_ulPropertyContainer, Prop_CanUnifyCoordinateSystemWithHmd_Bool, true);
422+
vr::VRProperties()->SetBoolProperty(m_ulPropertyContainer, Prop_ContainsProximitySensor_Bool, false);
423+
vr::VRProperties()->SetBoolProperty(m_ulPropertyContainer, Prop_DeviceCanPowerOff_Bool, false);
424+
vr::VRProperties()->SetInt32Property(m_ulPropertyContainer, vr::Prop_DeviceClass_Int32, vr::TrackedDeviceClass_HMD);
425+
vr::VRProperties()->SetBoolProperty(m_ulPropertyContainer, vr::Prop_HasCamera_Bool, false);
426+
vr::VRProperties()->SetBoolProperty(m_ulPropertyContainer, vr::Prop_Firmware_ForceUpdateRequired_Bool, false);
427+
vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_RegisteredDeviceType_String, "HMD");
428+
vr::VRProperties()->SetBoolProperty(m_ulPropertyContainer, vr::Prop_NeverTracked_Bool, false);
429+
vr::VRProperties()->SetBoolProperty(m_ulPropertyContainer, vr::Prop_Identifiable_Bool, false);
430+
413431
vr::VRProperties()->SetFloatProperty( m_ulPropertyContainer, Prop_UserIpdMeters_Float, m_flIPD );
414432
vr::VRProperties()->SetFloatProperty( m_ulPropertyContainer, Prop_UserHeadToEyeDepthMeters_Float, 0.f );
415433
vr::VRProperties()->SetFloatProperty( m_ulPropertyContainer, Prop_DisplayFrequency_Float, m_flDisplayFrequency );
@@ -607,6 +625,9 @@ class CDeviceDriver : public vr::ITrackedDeviceServerDriver, public vr::IVRDispl
607625

608626
pose.qWorldFromDriverRotation = HmdQuaternion_Init(1, 0, 0, 0);
609627
pose.qDriverFromHeadRotation = HmdQuaternion_Init(1, 0, 0, 0);
628+
pose.shouldApplyHeadModel = true;
629+
pose.poseTimeOffset = 0;
630+
pose.willDriftInYaw = false;
610631

611632
if (HMDConnected || ArduinoNotRequire) {
612633

0 commit comments

Comments
 (0)