#include "FuncRequest.h"
-#include "frontends/key_state.h"
+#include "frontends/KeyModifier.h"
#include "frontends/KeySymbol.h"
#include "support/docstream.h"
* @return the action / LFUN_COMMAND_PREFIX / LFUN_UNKNOWN_ACTION
*/
FuncRequest const &
- lookup(KeySymbol const & key,
- key_modifier::state mod, KeySequence * seq) const;
+ lookup(KeySymbol const & key, KeyModifier mod, KeySequence * seq) const;
///
typedef std::deque<KeySequence> Bindings;
/// Given an action, print the keybindings.
docstring const printbindings(FuncRequest const & func) const;
+ typedef std::pair<FuncRequest, KeySequence> Binding;
+ typedef std::vector<Binding> BindingList;
+ /**
+ * Return all lfun and their associated bindings.
+ * @param unbound list unbound (func without any keybinding) as well
+ */
+ BindingList const listBindings(bool unbound) const;
+
/**
* Given an action, find the first 1-key binding (if it exists).
* The KeySymbol pointer is 0 is no key is found.
* [only used by the Qt/Mac frontend]
*/
- std::pair<KeySymbol, key_modifier::state>
+ std::pair<KeySymbol, KeyModifier>
find1keybinding(FuncRequest const & func) const;
* @param mod the modifiers
*/
static std::string const printKeySym(KeySymbol const & key,
- key_modifier::state mod);
+ KeyModifier mod);
+
+ typedef std::pair<KeyModifier, KeyModifier> ModifierPair;
- typedef std::pair<key_modifier::state, key_modifier::state> modifier_pair;
private:
///
KeySymbol code;
/// Modifier masks
- modifier_pair mod;
+ ModifierPair mod;
/// Keymap for prefix keys
boost::shared_ptr<KeyMap> table;
*/
Bindings findbindings(FuncRequest const & func,
KeySequence const & prefix) const;
+
+ void listBindings(BindingList & list,
+ KeySequence const & prefix) const;
/// is the table empty ?
bool empty() const { return table.empty(); }