(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0be174"],{"2f7a":function(t,e,s){"use strict";s.r(e);var a=function(){var t=this;t._self._c;return t._m(0)},n=[function(){var t=this,e=t._self._c;return e("div",[e("h1",[t._v("KeyCommand instance")]),e("p",[t._v("The "),e("code",[t._v("keyCommand")]),t._v(" instance is responsible for adding and triggering shortcuts. It includes some built-in shortcuts and can also be added manually. The "),e("code",[t._v("mindMap.keyCommand")]),t._v(" instance can be obtained through this.")]),e("h2",[t._v("Methods")]),e("h3",[t._v("addShortcut(key, fn)")]),e("p",[t._v("Add a shortcut")]),e("p",[e("code",[t._v("key")]),t._v(": Shortcut key, key values can be viewed at "),e("a",{attrs:{href:"https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/core/command/keyMap.js"}},[t._v("keyMap.js")]),t._v(" Example:")]),e("pre",{staticClass:"hljs"},[e("code",[e("span",{staticClass:"hljs-comment"},[t._v("// Single key")]),t._v("\nmindMap.keyCommand.addShortcut("),e("span",{staticClass:"hljs-string"},[t._v('"Enter"')]),t._v(", "),e("span",{staticClass:"hljs-function"},[t._v("() =>")]),t._v(" {});\n"),e("span",{staticClass:"hljs-comment"},[t._v("// Or")]),t._v("\nmindMap.keyCommand.addShortcut("),e("span",{staticClass:"hljs-string"},[t._v('"Del|Backspace"')]),t._v(", "),e("span",{staticClass:"hljs-function"},[t._v("() =>")]),t._v(" {});\n"),e("span",{staticClass:"hljs-comment"},[t._v("// Combination key")]),t._v("\nmindMap.keyCommand.addShortcut("),e("span",{staticClass:"hljs-string"},[t._v('"Control+Enter"')]),t._v(", "),e("span",{staticClass:"hljs-function"},[t._v("() =>")]),t._v(" {});\n")])]),e("p",[e("code",[t._v("fn")]),t._v(": Method to be executed")]),e("h3",[t._v("removeShortcut(key, fn)")]),e("p",[t._v("Remove a shortcut command, if "),e("code",[t._v("fn")]),t._v(" is not specified, all callback methods for the shortcut will be removed")]),e("h3",[t._v("getShortcutFn(key)")]),e("blockquote",[e("p",[t._v("v0.2.2+")])]),e("p",[t._v("Get the processing function for the specified shortcut")]),e("h3",[t._v("pause()")]),e("blockquote",[e("p",[t._v("v0.2.2+")])]),e("p",[t._v("Pause all shortcut responses")]),e("h3",[t._v("recovery()")]),e("blockquote",[e("p",[t._v("v0.2.2+")])]),e("p",[t._v("Restore shortcut responses")]),e("h3",[t._v("save()")]),e("blockquote",[e("p",[t._v("v0.2.3+")])]),e("p",[t._v("Save the current registered shortcut data, then clear the shortcut data")]),e("h3",[t._v("restore()")]),e("blockquote",[e("p",[t._v("v0.2.3+")])]),e("p",[t._v("Restore saved shortcut data, then clear the cache data")])])}],o={},c=o,v=s("2877"),r=Object(v["a"])(c,a,n,!1,null,null,null);e["default"]=r.exports}}]);