# How to detect which motion controller is connected

**URL:** <https://forums.unrealengine.com/t/how-to-detect-which-motion-controller-is-connected/452738>\
**Category:** XR Development\
**Tags:** detection, Vive, Motion-Controller, unreal-engine, question\
**Created:** [July 24, 2019, 1:48pm UTC](https://forums.unrealengine.com/t/how-to-detect-which-motion-controller-is-connected/452738 "2019-07-24T13:48:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_b30f6442](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b30f6442](https://forums.unrealengine.com/u/anonymous_user_b30f6442)\
**Post date:** [July 24, 2019, 1:48pm UTC](https://forums.unrealengine.com/t/how-to-detect-which-motion-controller-is-connected/452738/1 "2019-07-24T13:48:24Z")

</div>

Hey all

So unreal has a nifty ‘Get HMD Device Name’ node that returns which headset the user is wearing. From there I am able to change the controls to work with Oculus Touch or Vive wand controllers. But now with the introduction of Knuckle controllers I can’t simply use the HMD device name node anymore, as it only returns the headset and not the controllers.

Is there a way for me to detect which type of controller is connected?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_942e8e52](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_942e8e52](https://forums.unrealengine.com/u/anonymous_user_942e8e52)\
**Post date:** [July 24, 2019, 1:50pm UTC](https://forums.unrealengine.com/t/how-to-detect-which-motion-controller-is-connected/452738/2 "2019-07-24T13:50:55Z")

</div>

Hello,

I haven’t implemented this myself - but just want to pass some information along:

"If you query the string ETrackedDeviceProperty::Prop\_ModelNumber\_String from OpenVR (using GetStringTrackedDeviceProperty), you can check the string to identify the controller.

For example some of our code: if(ControllerString.Contains(TEXT(“VIVE Controller”), ESearchCase::IgnoreCase)) { Result = ECoopVrControllerType::ViveWand; }

Note, don’t check full strings, that substring works on Vive and Vive Pro for example.

We do not use this method for Oculus - we run Oculus using their native plugin which uses a different approach. Oculus running through SteamVR will return something in those strings, but I don’t know if it will identify the controllers.

Using the Oculus API direct allows us to identify between “Touch” and “Touch for Rift S” - but requires a newer Oculus SDK than is in 4.22 (So the Oculus branch for now). That matters to us as they have the exact same input mapping, but for showing a model in tutorials etc, we need to know which the player has."
