+ /**
+ * Define/Undefine an action for a key sequence.
+ * @param r internal recursion level
+ */
+ void bind(KeySequence * seq, FuncRequest const & func,
+ unsigned int r = 0);
+ void unbind(KeySequence * seq, FuncRequest const & func,
+ unsigned int r = 0);
+
+
+ // if a keybinding has been defined.
+ bool hasBinding(KeySequence const & seq, FuncRequest const & func,
+ unsigned int r = 0);
+
+ // clear all bindings
+ void clear();
+
+ /** Parse a bind file. If a valid unbind_map is given, put \unbind
+ * bindings to a separate KeyMap. This is used in the Shortcut preference
+ * dialog where main and user bind files are loaded separately so \unbind
+ * in user.bind can not nullify \bind in the master bind file.
+ *
+ * @param bind_file bind file
+ * @param unbind_map pointer to a KeyMap that holds \unbind bindings
+ */
+ bool read(std::string const & bind_file, KeyMap * unbind_map = NULL);
+
+ /** write to a bind file.
+ * @param append append to the bind_file instead of overwrite it
+ * @param unbind use \unbind instead of \bind, indicating this KeyMap
+ * actually record unbind maps.
+ */
+ void write(std::string const & bind_file, bool append, bool unbind=false) const;