| bind | R Documentation |
bind() maps a key (or several keys separated by commas) to an action.
Bindings can be attached to the app (app()), to the screen, to a widget
type (widget()) or to a single widget (widget$bind()). When a key is
pressed, bindings are searched from the focused widget up to the app, so
the most local binding wins.
bind(key, action, description = NULL)
key |
Key name such as |
action |
Action name or a function. Functions bound on the app are
called as |
description |
Optional human readable description (for help screens and footers). |
An action is either the name of an action or a function. Named actions
are looked up on the widget that owns the binding, then on its
ancestors, then on the app. Prefix a name with "app." to call an app
action directly. Built-in app actions are "quit", "focus_next",
"focus_previous" and "refresh".
An object of class termr_binding.
bind("q", "quit")
bind("ctrl+r", function(app) app$refresh(), "Redraw")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.