Anniversary Sale · up to 80% off all librariesEnds Nov 9Shop now
SOFTTDocs

Toggle Input

Enable or disable the WebSerial Pro terminal input bar from firmware to control whether users can send commands.

WebSerial Pro feature. This functionality is available only in the commercial edition of WebSerial.

WebSerial Pro lets you enable or disable the command input bar of the terminal from your firmware. Use it to prevent user interaction during critical operations, such as a firmware update, or to make the terminal permanently read-only.

User input is enabled by default.

Disable user input

WebSerial.disableInput();
Disabled input bar

While input is disabled, messages received from the terminal are ignored and the onMessage() callback is not invoked.

Enable user input

WebSerial.enableInput();
Enabled input bar

Set the input state

setInput() enables or disables the input bar from a boolean value:

WebSerial.setInput(false);

Prop

Type

Notes

  • The input state is sent to the browser when the terminal connects. Reload the terminal page to see a change made while the page is open.

On this page