Simulate mouse click (with touch)

Get help using Construct 2

Post » Tue Apr 03, 2012 1:45 am

Hi Guys,

So, I've got a lot (dozens) of context sensitive events which are triggered by left-mouse click.

Now, I'd like to add touch controls, but rather than add a custom touch event for each context, I'd like to simply have a Touch condition where "Is touching <object>" simulates a Mouse left-click.

That way I could create a simple mouse icon, and touching it would simulate a left-click, triggering the event.

I've read through the touch tutorials, but nothing seems to cover this situation.

Thanks!

(I should be able to have something to share real soon :)) breravin2012-04-03 01:59:09
B
7
S
1
Posts: 24
Reputation: 935

Post » Tue Apr 03, 2012 2:16 am

B
16
S
3
G
4
Posts: 40
Reputation: 3,877

Post » Tue Apr 03, 2012 7:33 am

You don't need a custom plugin for that. It is built in.

Use the Touch-Plugin and look at the properties on the left side. There you can set that the Touch-Plugin listens to "Mouse-Input" - i.e a mouseclick is interpretet as on-touched-event. No you can replace all Mouse-click-events with Touch-events and finally delete the Mouse-object - but only if you do not use mouseover-events and similar.. Joe72012-04-03 07:33:24
B
14
S
6
G
5
Posts: 173
Reputation: 4,742

Post » Tue Apr 03, 2012 9:16 am

What about difference between left and right click?
Will they both be interpreted as on-touched-event?
B
15
S
5
G
1
Posts: 40
Reputation: 2,026

Post » Tue Apr 03, 2012 9:29 am

I have had lot of trouble using that mouse input setting. It doesn't seem to work as needed. If you make it for mobile devices, then important thing is to make sure you don't refer to Mouse.X,Mouse.Y anywhere.
B
40
S
5
G
5
Posts: 405
Reputation: 5,657

Post » Tue Apr 03, 2012 11:24 am

The only way I remember anyone implementing such a feature was when keeping some object pressed, a menu would appear. There's no way to simulate mouse button presses by touch, of course.
B
25
S
8
G
7
Posts: 184
Reputation: 6,040

Post » Tue Apr 03, 2012 11:30 am

@KiyowaraKush

TouchMouse plugin does not maintain anymore. Sorry.
B
97
S
22
G
178
Posts: 4,120
Reputation: 104,047

Post » Tue Apr 03, 2012 3:09 pm

[QUOTE=nemo] I have had lot of trouble using that mouse input setting. It doesn't seem to work as needed. If you make it for mobile devices, then important thing is to make sure you don't refer to Mouse.X,Mouse.Y anywhere.[/QUOTE]

Which part did you have trouble with? I've had success with it so far. Instead of Mouse.X etc, use Touch.X
B
19
S
2
Posts: 37
Reputation: 1,464

Post » Tue Apr 03, 2012 7:17 pm

[QUOTE=Joe7] You don't need a custom plugin for that. It is built in.

Use the Touch-Plugin and look at the properties on the left side. There you can set that the Touch-Plugin listens to "Mouse-Input" - i.e a mouseclick is interpretet as on-touched-event. No you can replace all Mouse-click-events with Touch-events and finally delete the Mouse-object - but only if you do not use mouseover-events and similar.. [/QUOTE]

Ah, this is an interesting idea. Still a bit more labor intensive than I'd like as it requires replacing probably more than a hundred mouse click events, but something to consider.

As mentioned, this also doesn't really help in the case where I need a right click (about 1/3 as often as left click, but still often).

In my situation a simulation would be the ultimate time saver, but... sounds like there's not much I can do.

I've also discovered that iOS performance is awful (about 1/4 that of a pc based browser, even after I've tried all the performance tricks), and I'm running into all the sound issues everyone else has with html5 (basically, none of it works). So, with that in mind I'm getting less and less motivated to get it working.

Kind of a bummer, but it's ok. breravin2012-04-03 19:18:32
B
7
S
1
Posts: 24
Reputation: 935


Return to How do I....?

Who is online

Users browsing this forum: emoticon, makkancs and 25 guests