Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.

Using IInputHandler for click/tap events

myieyemyieye
edited April 2018 in Questions And Answers

I'm trying to use tap/click events to drag holograms around and I can't get the IInputHandler.OnInputUp/OnInputDown events to fire.
Using a GestureRecogniser with Hold events is fine except that the "hold" takes too long to trigger in my game. The Tap gesture is not an option, because users use tap to simply select objects within starting to drag them.

It sounds like I just need to:
1) Add a HoloLens InputManager to my scene
2) Register the game object that implements IInputHandler as a global listener on the input manager

That hasn't worked so far. I only added the InputManager script, not the massively configurable InputManager prefab, because all I need are these input events. Are there other things I need to add to get it to work?

The problem is likely that the InputManager instance doesn't have any detected input sources (DetectedInputSources is empty). However, when using a gesture recognizer, the input sources just get detected automatically, so I assumed that would happen in this case as well.

I'm using Unity 2017.3.1f1. I guess the recommended version for HoloToolkit is 2017.2.

Tagged:

Best Answer

  • myieyemyieye
    Answer ✓

    @dbarrett said:
    I would just add the entire InputManager prefab, its not like its going to hurt anything. And if you are trying to drag your objects around the scene I would look into the IManipulationHandler, perhaps that would be better.

    Looks like you were right. Well...I added the prefab as well as the default cursor (I discovered the Mixed Reality Toolkit -> Configure -> Apply Mixed Reality Scene Settings dialog). And now the events get triggered just fine. I'm not sure what was wrong.

    Thanks for your help!

Answers

  • dbarrettdbarrett ✭✭✭

    I would just add the entire InputManager prefab, its not like its going to hurt anything. And if you are trying to drag your objects around the scene I would look into the IManipulationHandler, perhaps that would be better.

    AR Developer

  • @dbarrett I did try adding the prefab at one point. And then the app would no longer run (I had 2 errors at deploy time...something to do with boundaries and linear focus I think).

    You're right the manipulation gestures are more specifically designed for this, but I want to drag using raycasting from the user's gaze. (I'm making various different UIs for my master's thesis. Other UIs will certainly use the manipulation gestures).

  • myieyemyieye
    Answer ✓

    @dbarrett said:
    I would just add the entire InputManager prefab, its not like its going to hurt anything. And if you are trying to drag your objects around the scene I would look into the IManipulationHandler, perhaps that would be better.

    Looks like you were right. Well...I added the prefab as well as the default cursor (I discovered the Mixed Reality Toolkit -> Configure -> Apply Mixed Reality Scene Settings dialog). And now the events get triggered just fine. I'm not sure what was wrong.

    Thanks for your help!

Sign In or Register to comment.