mirror of
https://github.com/DrBeef/JKXR.git
synced 2024-11-28 15:02:13 +00:00
Fix use/crouch buttons on switched control schemes
This commit is contained in:
parent
5f56cf48fc
commit
587277fa7f
1 changed files with 24 additions and 11 deletions
|
@ -59,8 +59,23 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
|
||||||
int primaryButton2;
|
int primaryButton2;
|
||||||
int secondaryButton1;
|
int secondaryButton1;
|
||||||
int secondaryButton2;
|
int secondaryButton2;
|
||||||
int primaryThumb = (vr_control_scheme->integer == RIGHT_HANDED_DEFAULT || vr_switch_sticks->integer) ? xrButton_RThumb : xrButton_LThumb;
|
int primaryThumb;
|
||||||
int secondaryThumb = (vr_control_scheme->integer == RIGHT_HANDED_DEFAULT || vr_switch_sticks->integer) ? xrButton_LThumb : xrButton_RThumb;
|
int secondaryThumb;
|
||||||
|
if (vr_control_scheme->integer == LEFT_HANDED_DEFAULT && vr_switch_sticks->integer)
|
||||||
|
{
|
||||||
|
primaryThumb = xrButton_RThumb;
|
||||||
|
secondaryThumb = xrButton_LThumb;
|
||||||
|
}
|
||||||
|
else if (vr_control_scheme->integer == LEFT_HANDED_DEFAULT || vr_switch_sticks->integer)
|
||||||
|
{
|
||||||
|
primaryThumb = xrButton_LThumb;
|
||||||
|
secondaryThumb = xrButton_RThumb;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
primaryThumb = xrButton_RThumb;
|
||||||
|
secondaryThumb = xrButton_LThumb;
|
||||||
|
}
|
||||||
if (vr_switch_sticks->integer)
|
if (vr_switch_sticks->integer)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
@ -155,13 +170,11 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
|
||||||
}
|
}
|
||||||
|
|
||||||
//To skip flatscreen cinematic use thumb of any controller
|
//To skip flatscreen cinematic use thumb of any controller
|
||||||
if ((pDominantTrackedRemoteNew->Buttons & primaryThumb) !=
|
if ((primaryButtonsNew & primaryThumb) != (primaryButtonsOld & primaryThumb)) {
|
||||||
(pDominantTrackedRemoteOld->Buttons & primaryThumb)) {
|
sendButtonAction("+use", (primaryButtonsNew & primaryThumb));
|
||||||
sendButtonAction("+use", (pDominantTrackedRemoteNew->Buttons & primaryThumb));
|
|
||||||
}
|
}
|
||||||
if ((pOffTrackedRemoteNew->Buttons & secondaryThumb) !=
|
if ((secondaryButtonsNew & secondaryThumb) != (secondaryButtonsOld & secondaryThumb)) {
|
||||||
(pOffTrackedRemoteOld->Buttons & secondaryThumb)) {
|
sendButtonAction("+use", (secondaryButtonsNew & secondaryThumb));
|
||||||
sendButtonAction("+use", (pOffTrackedRemoteNew->Buttons & secondaryThumb));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -763,10 +776,10 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
|
||||||
}
|
}
|
||||||
|
|
||||||
//Use
|
//Use
|
||||||
if ((pDominantTrackedRemoteNew->Buttons & primaryThumb) !=
|
if ((primaryButtonsNew & primaryThumb) !=
|
||||||
(pDominantTrackedRemoteOld->Buttons & primaryThumb)) {
|
(primaryButtonsOld & primaryThumb)) {
|
||||||
|
|
||||||
sendButtonAction("+use", (pDominantTrackedRemoteNew->Buttons & primaryThumb));
|
sendButtonAction("+use", (primaryButtonsNew & primaryThumb));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue