This widget should avoid this behaviour of camera, for middle mouse button. But by enabling this widget, it should disable the possibility, at least in overhead camera mode, to navigate on map by holding middle mouse button. Above the minimap, this widget shouldn't disable the capacity to navigate with middle mouse button (maintained pressed or not).
(For installation of this widget, please see for example https://springrts.com/wiki/Lua_Widgets.)
(Code of this widget:
Code: Select all
function widget:GetInfo()
return {
name = "Disable middle mouse click above the map",
desc = "A widget to avoid camera like blocked or super fast, atfer an unmaintained middle click above the map",
author = "",
version = "2",
date = "2020",
license = "",
layer = 90051,
enabled = true,
}
end
function widget:MousePress(mx, my, button)
if (button == 2) and (not Spring.IsAboveMiniMap(mx, my)) then
return true
end
return false
end
(Another way to fix this behaviour and in addition to retaining the ability to navigate by holding middle mouse button pressed, could be if an argument "isRepeat" is added to "addon.MousePress(x, y, button)" (https://springrts.com/wiki/Lua:Callins) as there is already one for addon.KeyPress (addon.KeyPress(key, mods, isRepeat)).)
(edit: in this widget, unsure line "return false" is needed.)
Edit: widget upgraded to version 2, may 27, 2020: at least name and description of the widget changed.