MixedRealityToolkit-Unity icon indicating copy to clipboard operation
MixedRealityToolkit-Unity copied to clipboard

Clicker Doesn't Work

Open Caltato opened this issue 9 years ago • 30 comments

Hi, I'm having a little trouble getting the clicker input. From what I've gathered, all I should need to do is have my script extend IInputClickHandler and the clicker should call OnInputClicked. And if I want it to react without it needing to focus I just set a global listener as well right? Or am I doing this wrong?

I've done the above mentioned and it works for when I air tap. However the clicker still does nothing. (Though the clicker is connected to the Hololens)

Caltato avatar Oct 31 '17 06:10 Caltato

I'll need to dig up a clicker to test this with to confirm.

Make sure you're either gazing at the object you want to click or add the object to the InputManager's global listeners

Yea all you should need it the IInputClickHandler

StephenHodgson avatar Oct 31 '17 16:10 StephenHodgson

Yeap I have tried both adding it to global listeners as well as just gazing and clicking. Sadly, neither worked.

Caltato avatar Nov 01 '17 01:11 Caltato

Update: I tried using the clicker in the example scenes for input. Doesn't work. ;/ Any ideas for possible reasons as to why it isn't working? @StephenHodgson

Caltato avatar Nov 03 '17 00:11 Caltato

Haven't had time to verify this bug. Sorry.

StephenHodgson avatar Nov 03 '17 01:11 StephenHodgson

No worries! @StephenHodgson

Caltato avatar Nov 03 '17 01:11 Caltato

@Caltato see if PR #1256 fixed your issue.

I updated all the inputs that don't come from the controller to automatically use the select key press type

StephenHodgson avatar Nov 10 '17 20:11 StephenHodgson

@StephenHodgson Hey thanks! I'll try it out and update you when I get back to the office on Monday. Cheers

Caltato avatar Nov 11 '17 00:11 Caltato

Hi @StephenHodgson, it still doesn't seem to work, unfortunately. Does it work for you? If so, maybe I'm doing something wrong.

Caltato avatar Nov 13 '17 01:11 Caltato

I don't have a clicker to test with, so I can't confirm.

StephenHodgson avatar Nov 13 '17 01:11 StephenHodgson

Oh I see. Hmm...

Caltato avatar Nov 13 '17 01:11 Caltato

I was able to dig one up today. Here's what I found:

OnInputDown
Source: GesturesInput (HoloToolkit.Unity.InputModule.InteractionInputSource)  SourceId: 2000000004  InteractionPressKind: None

OnInputUp
Source: GesturesInput (HoloToolkit.Unity.InputModule.InteractionInputSource)  SourceId: 2000000004  InteractionPressKind: None

OnInputClicked
Source: GesturesInput (HoloToolkit.Unity.InputModule.InteractionInputSource)  SourceId: 0  InteractionPressKind: Select  TapCount: 1

Seems like the clicker source is raising OnInputClicked correctly (although from the wrong SourceId, but not raising OnInputUp/Down correctly with the right press type.

StephenHodgson avatar Nov 14 '17 01:11 StephenHodgson

Ha, so the apparently the Clicker counts as a InteractionSourceKind.Controller but when it's clicked does not correctly raise the InteractionSourcePressType.Select properly. It's the same issue we were having with the hands in the HoloLens.

I'll have to write a HACK workaround for now, but this should be submitted as a bug to Unity/MSFT.

StephenHodgson avatar Nov 14 '17 01:11 StephenHodgson

Oh! I see. But if it raises OnInputClicked correctly why doesn't it call the code in the function?

Caltato avatar Nov 14 '17 01:11 Caltato

Not sure, I can get the OnInputClicked just fine for me, in the InputManagerTest scene.

Just the other stuff isn't working properly.

StephenHodgson avatar Nov 14 '17 01:11 StephenHodgson

HAHA Oh man. The test scene doesn't work for me though

Caltato avatar Nov 14 '17 01:11 Caltato

What version of the Editor are you running?

I'm using 2017.2.0p1 MRTP4

StephenHodgson avatar Nov 14 '17 01:11 StephenHodgson

I tried both 2017.1.2f1 and 2017.2.0f3

Caltato avatar Nov 14 '17 01:11 Caltato

I could see why 2017.2.0f3 wouldn't work.

StephenHodgson avatar Nov 14 '17 01:11 StephenHodgson

But 2017.1.x I'm surprised doesn't

StephenHodgson avatar Nov 14 '17 01:11 StephenHodgson

Yeah. I dont know. I'm quite stuck

Caltato avatar Nov 14 '17 01:11 Caltato