X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FKeyMap.h;h=acb0c22110ccdd0093a52aadd9e4a0802dfee1a0;hb=9337d73f1f9a6d4dae2e239e9f679a7452660c40;hp=f52fabb425d9bbeeb831cea8bf172745bb3b3856;hpb=a8cd9a4b8fd325b00c75f601c66c6d618ba276db;p=lyx.git diff --git a/src/KeyMap.h b/src/KeyMap.h index f52fabb425..acb0c22110 100644 --- a/src/KeyMap.h +++ b/src/KeyMap.h @@ -15,23 +15,17 @@ #define KEYMAP_H #include "FuncRequest.h" - -#include "frontends/KeyModifier.h" -#include "frontends/KeySymbol.h" +#include "KeySequence.h" #include "support/strfwd.h" #include -#include #include -#include namespace lyx { -class KeySequence; - /// Defines key maps and actions for key sequences class KeyMap { public: @@ -96,15 +90,21 @@ public: lookup(KeySymbol const & key, KeyModifier mod, KeySequence * seq) const; /// - typedef std::deque Bindings; + typedef std::vector Bindings; /// Given an action, find all keybindings. - Bindings findbindings(FuncRequest const & func) const; + Bindings findBindings(FuncRequest const & func) const; /// Given an action, print the keybindings. - docstring const printbindings(FuncRequest const & func) const; - - typedef boost::tuple Binding; + docstring printBindings(FuncRequest const & func) const; + + struct Binding { + Binding(FuncRequest const & r, KeySequence const & s, int t) + : request(r), sequence(s), tag(t) {} + FuncRequest request; + KeySequence sequence; + int tag; + }; typedef std::vector BindingList; /** * Return all lfun and their associated bindings. @@ -138,13 +138,10 @@ private: struct Key { /// Keysym KeySymbol code; - /// Modifier masks ModifierPair mod; - /// Keymap for prefix keys boost::shared_ptr table; - /// Action for !prefix keys FuncRequest func; }; @@ -154,7 +151,7 @@ private: * @param func the action * @param prefix a sequence to prepend the results */ - Bindings findbindings(FuncRequest const & func, + Bindings findBindings(FuncRequest const & func, KeySequence const & prefix) const; void listBindings(BindingList & list, KeySequence const & prefix,