Forum Discussion
Avengar
7 years agoHonored Guest
Detecting which controllers are plugged in
I'm currently working on detecting plugged in controllers for Oculus Rift and also for Oculus GO. Here is function that I've come up with:
(it's added to the OculusInput.cpp)
(it's added to the OculusInput.cpp)
FString FOculusInput::GetPluggedControllerName(){ FString ControllerType = "None";
ovrpControllerState4 OvrpControllerState;
if (OVRP_SUCCESS(ovrp_GetControllerState4(ovrpController_Active, &OvrpControllerState))) { switch (OvrpControllerState.ConnectedControllerTypes) { case ovrpController_Touch: ControllerType = "Oculus_touch"; break;
case ovrpController_Gamepad: ControllerType = "Gamepad"; break;
default: ControllerType = "Default"; GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Red, FString::FromInt(OvrpControllerState.ConnectedControllerTypes)); break; } }
return ControllerType;}It works well when i have only one of them plugged in, it will never work if i have both touch and gamepad plugged in my pc. My queston is if it's there any way to split that? Do i have to just check those hexadecimal values before? Also how can i detect if it's Oculus GO controller?
1 Reply
- mouse_bearRetired Support@Avengar
Let me inquire within and try to get you an answer. I'll update you here once I get a response.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 2 years ago