Skip to content

Commit

Permalink
Fix for seconday buttons toggle issue
Browse files Browse the repository at this point in the history
  • Loading branch information
DrBeef committed Jun 2, 2020
1 parent 528a5dc commit d115870
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions Projects/Android/jni/QzDoom/VrInputDefault.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
}

//Dominant Grip works like a shift key
bool dominantGripPushedOld =
(pDominantTrackedRemoteOld->Buttons & ovrButton_GripTrigger) != 0;
bool dominantGripPushedNew =
(pDominantTrackedRemoteNew->Buttons & ovrButton_GripTrigger) != 0;
bool dominantGripPushedOld = vr_secondarybuttonmappings ?
(pDominantTrackedRemoteOld->Buttons & ovrButton_GripTrigger) != 0 : false;
bool dominantGripPushedNew = vr_secondarybuttonmappings ?
(pDominantTrackedRemoteNew->Buttons & ovrButton_GripTrigger) != 0 : false;

ovrInputStateTrackedRemote *pPrimaryTrackedRemoteNew, *pPrimaryTrackedRemoteOld, *pSecondaryTrackedRemoteNew, *pSecondaryTrackedRemoteOld;
if (vr_switchsticks)
Expand Down Expand Up @@ -363,10 +363,8 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
//Use grip as an extra button
//Alt-Fire
Joy_GenerateButtonEvents(
((pDominantTrackedRemoteOld->Buttons & ovrButton_GripTrigger) != 0) &&
dominantGripPushedOld ? 1 : 0,
((pDominantTrackedRemoteNew->Buttons & ovrButton_GripTrigger) != 0) &&
dominantGripPushedNew ? 1 : 0,
((pDominantTrackedRemoteOld->Buttons & ovrButton_GripTrigger) != 0) ? 1 : 0,
((pDominantTrackedRemoteNew->Buttons & ovrButton_GripTrigger) != 0) ? 1 : 0,
1, KEY_PAD_LTRIGGER);
}

Expand Down

0 comments on commit d115870

Please sign in to comment.