Input.simulateMouseWithTouches in StandardInput

Random discussions.

Input.simulateMouseWithTouches in StandardInput

Postby zsaladin » Fri Sep 01, 2017 3:17 pm

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'?
zsaladin
 
Posts: 4
Joined: Fri Sep 01, 2017 3:10 pm

Re: Input.simulateMouseWithTouches in StandardInput

Postby valyard » Fri Sep 01, 2017 8:44 pm

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.
valyard
Site Admin
 
Posts: 435
Joined: Mon Sep 08, 2014 11:57 pm

Re: Input.simulateMouseWithTouches in StandardInput

Postby zsaladin » Sat Sep 02, 2017 8:17 am

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!
zsaladin
 
Posts: 4
Joined: Fri Sep 01, 2017 3:10 pm

Re: Input.simulateMouseWithTouches in StandardInput

Postby valyard » Sat Sep 02, 2017 9:18 pm

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?
valyard
Site Admin
 
Posts: 435
Joined: Mon Sep 08, 2014 11:57 pm

Re: Input.simulateMouseWithTouches in StandardInput

Postby zsaladin » Sun Sep 03, 2017 4:41 am

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!
zsaladin
 
Posts: 4
Joined: Fri Sep 01, 2017 3:10 pm

Re: Input.simulateMouseWithTouches in StandardInput

Postby valyard » Sun Sep 03, 2017 4:05 pm

Well, you can just comment that line in TouchScript where Input.simulateMouseWithTouches is set to false. Something might break or not (8
valyard
Site Admin
 
Posts: 435
Joined: Mon Sep 08, 2014 11:57 pm

Re: Input.simulateMouseWithTouches in StandardInput

Postby zsaladin » Sun Sep 03, 2017 4:47 pm

Thank you for your answer. I'll do that and hope nothing will break.
zsaladin
 
Posts: 4
Joined: Fri Sep 01, 2017 3:10 pm


Return to General Discussion

Who is online

Users browsing this forum: Google [Bot] and 1 guest