PunchablePlushie / godot-game-settings

Create and manage game settings in Godot Engine.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mouse with more than 5 buttons can index outside the expected array

Norodix opened this issue · comments

I have a mouse that has a 3rd button between the "next" and "previous" buttons. Using this button with and input setting causes a crash.

It crashes at ggs_input_helper.gd:192.

The keywords["mouse"] array has all the Godot mouse button constants (MOUSE_BUTTON_*). I'm not sure how handling input binding for mice with 5+ buttons would work. For now, I've added a simple check that prevents the rebind window from accepting mouse input events that are outside the constants defined by Godot itself. This should at the very least prevent crashes.
Sadly, I don't have a way to check if it actually works or not by myself though.