| command | R Documentation |
A command is something the user can do: it has a label, an action, an
optional category and keyboard shortcut, and may be enabled or disabled
depending on the app state. The command palette (Ctrl+P) and the help
screen (F1) are built from the same list: commands added with
app$add_command(), the described key bindings of the focused widget, its
ancestors and the app, and the app's named actions. Existing bind()
bindings keep working and appear in both.
command(
label,
action,
category = NULL,
shortcut = NULL,
enabled = NULL,
description = NULL
)
label |
Text shown in the palette and the help screen. |
action |
An action name or a |
category |
Optional group name, e.g. |
shortcut |
Optional key shown next to the command (documentation
only; use |
enabled |
|
description |
Optional longer text for the help screen. |
An object of class termr_command.
command("Save", action = "save", category = "File", shortcut = "ctrl+s")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.