Hotkeys demo

Try pressing up/down/left/right/del. The buttons below enable/disable the hotkeys (useful if you have another component on the page that may use keyboard navigation). You can attach the enable command to the onfocus event if you will - that way if the user clicks anywhere inside the tree container shortcuts will start working.

01.$(function () {
02.    $("#demo_1").tree({
03.        // select a node initially so that you can start pounding up/down/left/right right away :)
04.        selected : "phtml_1",
05.        plugins : {
06.            hotkeys : {
07.                functions : {
08.                    // lets add our own
09.                    "s" : function () {
10.                        alert($.tree.focused().container.attr("id"));
11.                    }
12.                }
13.            }
14.        }
15.    });
16.});

1.<input type="button" onclick="$.tree.plugins.hotkeys.disabled = true; this.blur();" value="Disable">
2.<input type="button" onclick="$.tree.plugins.hotkeys.disabled = false; this.blur();" value="Enable">