Request - a way to turn off touch rightclicks

Discussion and feedback on Construct 2

Post » Tue May 28, 2013 9:29 pm

I'm using the touch plugin for both touch and mouse controls, but there's a problem - 'on touch' fires for left, middle and right mouse clicks, and I have no idea how to differentiate between them as adding a 'right mouse is down' condition doesn't work. I tried adding an 'on right click' event before it to set a variable but it isn't working right, presumably because triggers run out of sequence.

As it is, it appears the only way to bypass this is to have a mostly redundant set of code for mouse control.

Something like an extra option in the properties of the touch plugin for use mouse input, instead of yes/no, perhaps yes/no/left click only would work well.Arima2013-05-28 21:31:33
Moderator
B
95
S
34
G
33
Posts: 3,007
Reputation: 27,876

Post » Wed May 29, 2013 3:10 am

It's a conflict between Touch and Mouse, you should separate them as touch for mobile version and mouse for desktop version.
B
99
S
35
G
29
Posts: 3,139
Reputation: 28,421

Post » Wed May 29, 2013 6:31 am

If C2 had the option I mentioned, I wouldn't have to. It would very useful to myself and I think others as well, so we could have one set of code rather than needing duplicate code for both, and it seems like it wouldn't be hard to implement.
Moderator
B
95
S
34
G
33
Posts: 3,007
Reputation: 27,876

Post » Wed May 29, 2013 6:46 pm

[QUOTE=Arima].. It would very useful to myself and I think others as well, so we could have one set of code rather than needing duplicate code for both...[/QUOTE]
I do agree this would be useful and hope that it can be implemented
B
42
S
12
G
6
Posts: 136
Reputation: 6,397

Post » Wed May 29, 2013 7:40 pm

The intent in this case is that you would turn off 'Use mouse input' on the Touch object and code touch and mouse input separately.
Scirra Founder
B
399
S
236
G
89
Posts: 24,530
Reputation: 195,402

Post » Wed May 29, 2013 7:43 pm

@Ashley - I know it's doable that way, but then all the code for left clicking has to duplicated, and if any bugs are found, then they need to be fixed twice. If this was implemented, it would be one set of code to maintain.
Moderator
B
95
S
34
G
33
Posts: 3,007
Reputation: 27,876

Post » Wed May 29, 2013 7:48 pm

What about:

if (not mouse left click)
    turn off Mouse Input
else
    turn it on

Could this work?
B
53
S
12
G
7
Posts: 133
Reputation: 9,380

Post » Wed May 29, 2013 7:52 pm

Not really - it still requires two sets of code for registering mouse and touch triggers.
Moderator
B
95
S
34
G
33
Posts: 3,007
Reputation: 27,876

Post » Wed May 29, 2013 8:02 pm

@Arima - if you use OR blocks or functions, doesn't that eliminate any duplicate code?
Scirra Founder
B
399
S
236
G
89
Posts: 24,530
Reputation: 195,402

Post » Wed May 29, 2013 8:13 pm

Why not just use buttons for everything?
Image ImageImage
B
171
S
50
G
179
Posts: 8,392
Reputation: 113,478

Next

Return to Construct 2 General

Who is online

Users browsing this forum: Yahoo [Bot] and 10 guests