More mouse buttons?

Discussion and feedback on Construct 2

Post » Mon Apr 11, 2016 4:28 pm

From what I can see, Construct only supports the three main buttons of mice, I am informed that it is possible in JavaScript to get input on all mouse buttons, here: https://www.w3.org/TR/DOM-Level-3-Event ... ouseevents. I was thinking of implmenting this myself with the SDK, but I don't see how that would work without changing the original mouse plugin. So can I request here that the ability to have button codes for the mouse a feature of Construct?
Nothing goes unanswered!
B
24
S
5
G
1
Posts: 434
Reputation: 3,446

Post » Mon Apr 11, 2016 8:26 pm

It could be useful for more complex games, especially for key rebinding options.
B
135
S
33
G
17
Posts: 1,557
Reputation: 20,715

Post » Mon Apr 11, 2016 9:57 pm

B
92
S
32
G
106
Posts: 5,272
Reputation: 69,455

Post » Tue Apr 12, 2016 6:00 am


Sadly, the beginner devs won't be able to utilize this. Still, it's very useful, thank you for sharing it.
B
135
S
33
G
17
Posts: 1,557
Reputation: 20,715

Post » Tue Apr 12, 2016 2:50 pm

@R0J0hound , sorry for being so dumb, but how does your example work? It does nothing in my system, I tried any browser available and nothing gets added on the textbox object when I mouse click!
composer - multimedia artist
www.eli0s.com/en/
B
69
S
26
G
5
Posts: 1,146
Reputation: 9,829

Post » Tue Apr 12, 2016 2:59 pm

The mouse has to be outside of the Textbox, or the textbox will grab the events, in this example. It doesn't report all buttons though. I have 5 buttons, but only the main three report anything.
ImageImageImage
B
71
S
21
G
230
Posts: 3,688
Reputation: 128,847

Post » Tue Apr 12, 2016 3:24 pm

@glerikud
Why not? A beginner just needs to copy the start of layout event, then any function called "click" will be called when a button is clicked, and the first parameter will be the button number.

@eli0s
As blackhornet says it only works clicking outside of the textbox.

@blackhornet
That's interesting. I only have a standard mouse so I couldn't test.I guess it depends of the mouse or something.
B
92
S
32
G
106
Posts: 5,272
Reputation: 69,455

Post » Tue Apr 12, 2016 4:23 pm

R0J0hound wrote:Why not? A beginner just needs to copy the start of layout event, then any function called "click" will be called when a button is clicked, and the first parameter will be the button number.

Because the beginner developers won't even know how to use functions. :) I'm not trying to be picky or anything, I'm just saying it might worth to offically support this with the mouse plugin.
B
135
S
33
G
17
Posts: 1,557
Reputation: 20,715

Post » Tue Apr 12, 2016 4:27 pm

@R0J0hound , ah, ok! I can confirm what @blackhornet said, only button 0, 1 and 2 are registering, nothing happens when I use the thumb buttons... That's a bummer, I had been asking for that feature for so long now... :(
composer - multimedia artist
www.eli0s.com/en/
B
69
S
26
G
5
Posts: 1,146
Reputation: 9,829

Post » Tue Apr 12, 2016 5:13 pm

I'm guessing the browsers themselves aren't checking those other buttons perhaps, the spec seems to allow it though. More than three buttons is non-standard so it's probably something more complicated like gamepads, but there doesn't seem to be any other way to access the mouse from js.

I don't see any issue with giving beginners something new to learn, and in this case it's just a matter of using it like the example provided.
B
92
S
32
G
106
Posts: 5,272
Reputation: 69,455

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 4 guests