Skip to content

Commit 15a3e23

Browse files
committed
specify click on tap input
1 parent dc5e104 commit 15a3e23

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/TrackerDevice.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,9 @@ void SlimeVRDriver::TrackerDevice::PositionMessage(messages::Position &position)
7575
}
7676

7777
if (is_controller_) {
78+
// Get inputs from protobuf
7879
bool double_tap = false;
7980
bool triple_tap = false;
80-
81-
// Get inputs from protobuf
8281
for (int i = 0; i < position.input_size(); ++i) {
8382
if (position.input(i).type() == messages::Input_InputType_DOUBLE_TAP) {
8483
double_tap = true;
@@ -239,10 +238,10 @@ vr::EVRInitError SlimeVRDriver::TrackerDevice::Activate(uint32_t unObjectId) {
239238

240239
// Set inputs
241240
if (is_controller_) {
242-
GetDriver()->GetInput()->CreateBooleanComponent(props, "/input/double_tap", &this->double_tap_component_);
243-
GetDriver()->GetInput()->CreateBooleanComponent(props, "/input/triple_tap", &this->triple_tap_component_);
244-
245241
GetDriver()->GetProperties()->SetStringProperty(props, vr::Prop_InputProfilePath_String, "{slimevr}/input/slimevr_controller_bindings.json");
242+
243+
GetDriver()->GetInput()->CreateBooleanComponent(props, "/input/double_tap/click", &this->double_tap_component_);
244+
GetDriver()->GetInput()->CreateBooleanComponent(props, "/input/triple_tap/click", &this->triple_tap_component_);
246245
}
247246

248247
// Automatically select vive tracker roles and set hints for games that need it (Beat Saber avatar mod, for example)

0 commit comments

Comments
 (0)