Page 1 of 1

[0.16.19] Middle Mouse click not detected in on_gui_click

Posted: Thu Jan 25, 2018 10:32 pm
by Peppe
Middle Mouse click not detected in on_gui_click event

Works in .15 does not work in .16.


script.on_event(defines.events.on_gui_click, function(event)
local button = event.button

-- Print button to player chat

)

Left click prints 2
Right click prints 4
Middle click no output, not captured ?


Full mod: https://mods.factorio.com/mod/production-monitor

Re: [0.16.19] Middle Mouse click not detected in on_gui_click

Posted: Thu Jan 25, 2018 10:40 pm
by Rseding91
Thanks for the report. By default buttons only respond to left/right click. If you want them to respond to other buttons you need to set the mouse button filter to include the ones you want. http://lua-api.factorio.com/latest/LuaG ... ton_filter

Re: [0.16.19] Middle Mouse click not detected in on_gui_click

Posted: Thu Jan 25, 2018 10:53 pm
by Peppe
Rseding91 wrote:Thanks for the report. By default buttons only respond to left/right click. If you want them to respond to other buttons you need to set the mouse button filter to include the ones you want. http://lua-api.factorio.com/latest/LuaG ... ton_filter
That would do it.

Resolved Thanks,
Peppe