Page 1 of 1
Simulating Mouse click
Posted: Thu Oct 08, 2015 11:52 pm
by Imerion
A bit of an odd question perhaps, but is there a way to simulate a mouse-click? So a piece of code can trigger the same effect as clicking the left mouse button does?
If I could do this, and automatically activate any KeyPress components that happen to be active, I could make my whole game touch-compatible with a single piece of code.

Re: Simulating Mouse click
Posted: Fri Oct 09, 2015 12:02 am
by Kjell
Hi Imerion,
A touch input ( of the first touch ID ) is already treated as a left-mouse click .. so checking for left-mouse-button in a KeyPress should do the trick. But maybe you've already tried that and it didn't work for some reason?
K
Re: Simulating Mouse click
Posted: Mon Oct 12, 2015 1:23 am
by Imerion
That is smart! But it doesn't seem to work, no. I'll try a few things (now that I know it should be possible) and return when I have some results.

Re: Simulating Mouse click
Posted: Mon Oct 12, 2015 8:42 am
by VilleK
Are you talking about touch for Android or for Windows? Because I'm pretty sure the script "touch" functions are not yet implemented on Windows

. I've never had access to a Windows touch device to test on.
Re: Simulating Mouse click
Posted: Mon Oct 12, 2015 3:11 pm
by Imerion
Android, but it does work! I just needed to adjust a few things.
