Page 1 of 1

Input.simulateMouseWithTouches in StandardInput

PostPosted: Fri Sep 01, 2017 3:17 pm
by zsaladin
I'm wondering why Input.simulateMouseWithTouches in StandardInput set to 'false'.
In Unity this default value is true.

My app targeting iOS is using Input.MouseButtonDown and Input.MouseButtonUp.
I took much time to find out why it did not work on iOS but in editor it worked.
So I removed the code Input.simulateMouseWithTouches = false;

Is there any reason it's set to 'false'?

Re: Input.simulateMouseWithTouches in StandardInput

PostPosted: Fri Sep 01, 2017 8:44 pm
by valyard
The idea is that all pointer interaction goes through TouchScript. With Input.simulateMouseWithTouches set to true Unity dispatches additional mouse events for the main touch which essentially just duplicates the pointers.

Though, right now setting it to true shouldn't affect TouchScript touch processing because it ignores mouse on mobiles. But there was a request to implement mouse on Android, where Input.simulateMouseWithTouches will have to be set to false.

Re: Input.simulateMouseWithTouches in StandardInput

PostPosted: Sat Sep 02, 2017 8:17 am
by zsaladin
Thank you for your reply.

So are you saying that I have to change that my code based on Input.GetMouseButton* should use TouchScript?

I can do that but what about the plugins based on Input.GetMouseButton* ?
And what if they are built into dll which I can't modify?

It would be great if you could give me some advice on it or any other option.
Thank you!

Re: Input.simulateMouseWithTouches in StandardInput

PostPosted: Sat Sep 02, 2017 9:18 pm
by valyard
So are you saying that I have to change that my code based on Input.GetMouseButton* should use TouchScript?


Yes, having two input schemes will hurt you at some point.

I can do that but what about the plugins based on Input.GetMouseButton* ?


Do you actually have such plugins in the project? Don't they duplicate TouchScript functionality?

Re: Input.simulateMouseWithTouches in StandardInput

PostPosted: Sun Sep 03, 2017 4:41 am
by zsaladin
I'm not sure now. But after now I have to care whether plugins which have been added or will be added use Input.GetMouseButton* or not.
So I want to know there is solution it if they conflict.

Thank you!

Re: Input.simulateMouseWithTouches in StandardInput

PostPosted: Sun Sep 03, 2017 4:05 pm
by valyard
Well, you can just comment that line in TouchScript where Input.simulateMouseWithTouches is set to false. Something might break or not (8

Re: Input.simulateMouseWithTouches in StandardInput

PostPosted: Sun Sep 03, 2017 4:47 pm
by zsaladin
Thank you for your answer. I'll do that and hope nothing will break.