[2.0.66] CustomInputEvent set to mouse buttons doesn't raise when clicking on GUIs
Posted: Thu Sep 11, 2025 9:30 pm
The custom input event is defined like this:
And i react to it like this:
When clicking "in-world" (in-game and in remote view), the event is raised and prints nil as expected. However when clicking on any GUI, be it a base game one or a mod GUI, the event is not raised at all. This only happens when the custom input is set to left, right or middle mouse button. Setting it to mouse button 4, or keyboard buttons raises the event normally.
Code: Select all
{
type = "custom-input",
name = "right-click",
key_sequence = "mouse-button-2",
action = "lua",
}
Code: Select all
script.on_event("right-click", function(event)
game.print(event.element)
end)