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.
Simulating Mouse click
Moderator: Moderators
Re: Simulating Mouse click
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
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
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
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
Android, but it does work! I just needed to adjust a few things.