Name
SetConsoleOptions -- configure console settings (V10.0)
Synopsis
SetConsoleOptions(table)
Platforms
Linux, macOS, Windows

Function
This function can be used to configure several settings that determine how the console should behave in advanced console mode. You must enable advanced console mode using EnableAdvancedConsole() before you can use this function. See EnableAdvancedConsole for details.

SetConsoleOptions() accepts a single table argument that can contain the following tags:

Delay:
If this tag is set to False, ReadConsoleKey() won't wait until a key is pressed but will return immediately if no key is pressed. Defaults to True.

HalfDelay:
When Delay is set to True, HalfDelay can be used to specify a time limit to be specified, in tenths of a second. This causes ReadConsoleKey() to block for that period before returning #CONSOLEKEY_NONE if no key has been received. If set, this value must be between 1 and 255.

Echo:
If this tag is set to False, typed characters won't be echoed in the console. Defaults to True.

Keypad:
If this tag is set to True, ReadConsoleKey() will also be able to read function keys like F1, F2, cursor keys, ESC, etc. Defaults to False.

Scroll:
If this tag is set to True, the console will automatically scroll the console when writing past the end of the console window. Defaults to False.

Clear:
If this tag is set to True, RefreshConsole() will clear the screen completely and redraw the entire screen. Defaults to False.

Leave:
If this tag is set to True, the cursor will be left wherever a screen update happens to leave it. This can be useful for applications where the cursor is not used, since it reduces the need for cursor motions. If possible, the cursor is made invisible when this option is enabled. Defaults to False.

Immediate:
If this tag is set to True, the console window will be refreshed every time a change is made to it. Defaults to False.

CBreak:
When Delay is set to True, CBreak controls which characters can make ReadConsoleKey() stop blocking and return. If CBreak is set to True, one key press will be enough to make ReadConsoleKey() stop blocking and return. If CBreak is set to False, however, ReadConsoleKey() will block until a newline occurs.

Newline:
If this is set to True, newlines are translated to carriage returns on input. If you don't want that, set Newline to False. Defaults to True.

Inputs
table
table containing one or more settings to modify (see above)

Show TOC