- Documentation
- Client functions
- setMinimizeKeyEnabled
Function
setMinimizeKeyEnabled
Turns minimising the game with the F11 key on or off. When it is off, F11 does not minimise the game but still works in bindKey, so the server can bind its own function to it (e.g. a custom map).
Syntax
bool setMinimizeKeyEnabled(bool enabled)Arguments
enabledboolfalseturns minimising off,truebrings it back.
Returns
true after the change, false for a bad argument (with a console warning).
Example
F11 opens the server's own map instead of minimising the game.
setMinimizeKeyEnabled(false)
local mapOpen = false
bindKey("F11", "down", function()
mapOpen = not mapOpen
showCursor(mapOpen)
end)
Notes
Per resource. The setting lasts until the resource turns it back on or is stopped. F11 minimises the game again only when no resource has it turned off.
See also
isMinimizeKeyEnabledChecks whether the F11 key minimises the game. Returnsfalsewhen any resource turned it off withsetMinimizeKeyEnabled.bindKeyBinds a function or a command to a player's key. The function gets (on the server also the player) the key name, the state and the extra arguments frombindKey. Instead of a function you can pass a command name: the key runs it like/command. On the server the player's game watches the key and reports presses to the server.