You are browsing the old site - check the new version out

back to the documentation homepage

jsTree v.1.0

hotkeys plugin

Description

The hotkeys plugin enables keyboard navigation and shortcuts. Depends on the jquery.hotkeys plugin.

Configuration

Expects an object:
each key is the keyboard shortcut (for possible values check the hotkeys plugin)
each value is a function executed in the instance's context, the return value is used as a return value for the event.

Simple example:

"del" : function () { this.remove(); }

By default "up", "ctrl+up", "shift+up", "down", "ctrl+down", "shift+down", "left", "ctrl+left", "shift+left", "right", "ctrl+right", "shift+right", "space", "ctrl+space", "shift+space", "f2", "del" are bound.
To override any of those - just specify your own function, to disable - just set to false.

Demos

Using the hotkeys plugin

Try pressing up/down/left/right/space/f2/del.

API

.enable_hotkeys ( )

Enable shortcuts on the instance (enabled by default).

.disable_hotkeys ( )

Disable shortcuts on the instance.