mirror of https://github.com/bjornbytes/lovr.git
For Quest, discern left/right XY/AB buttons
The VrApi implementation now checks that X, Y, A, B buttons exist on that specific controller. X,Y are on left; A,B on the right controller. That mapping covers Quest Touch and Quest 2 controllers.
This commit is contained in:
parent
ee3ba6ef3e
commit
2e82dfce92
|
@ -247,6 +247,14 @@ static bool vrapi_isDown(Device device, DeviceButton button, bool* down, bool* c
|
|||
return false;
|
||||
}
|
||||
|
||||
if (device == DEVICE_HAND_LEFT && (button == BUTTON_A || button == BUTTON_B)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (device == DEVICE_HAND_RIGHT && (button == BUTTON_X || button == BUTTON_Y)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (state.hands[device - DEVICE_HAND_LEFT].Type != ovrControllerType_TrackedRemote) {
|
||||
return false;
|
||||
}
|
||||
|
@ -275,6 +283,14 @@ static bool vrapi_isTouched(Device device, DeviceButton button, bool* touched) {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (device == DEVICE_HAND_LEFT && (button == BUTTON_A || button == BUTTON_B)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (device == DEVICE_HAND_RIGHT && (button == BUTTON_X || button == BUTTON_Y)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (state.hands[device - DEVICE_HAND_LEFT].Type != ovrControllerType_TrackedRemote) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue