Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit abf796f

Browse files
committed
Fix Pico G2 controller touchpad in immersive mode (#3587)
1 parent 96aab33 commit abf796f

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

app/src/picovr/cpp/DeviceDelegatePicoVR.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,11 @@ struct DeviceDelegatePicoVR::State {
223223
}
224224
} else {
225225
const int32_t kNumAxes = 2;
226-
float axes[kNumAxes] = { controller.axisX , -controller.axisY };
226+
float axes[kNumAxes] = { 0.0f, 0.0f };
227+
if (controller.touched) {
228+
axes[device::kImmersiveAxisTouchpadX] = (2.0f * controller.axisX) - 1.0f;
229+
axes[device::kImmersiveAxisTouchpadY] = (2.0f * controller.axisY) - 1.0f;
230+
}
227231
controllerDelegate->SetAxes(i, axes, controller.index != GazeModeIndex() ? kNumAxes : 0);
228232

229233
if (controller.touched) {

0 commit comments

Comments
 (0)