]> git.lyx.org Git - lyx.git/blobdiff - src/KeyMap.h
adjust
[lyx.git] / src / KeyMap.h
index 8cd372881e390200e6fa2579f07cc8e2f1d02bf0..c3ff0820e0ac0feefd0e6c195d896c1900ba5c3e 100644 (file)
@@ -16,7 +16,7 @@
 
 #include "FuncRequest.h"
 
-#include "frontends/key_state.h"
+#include "frontends/KeyModifier.h"
 #include "frontends/KeySymbol.h"
 
 #include "support/docstream.h"
@@ -47,8 +47,8 @@ public:
 
        /**
         * print all available keysyms
-        * @param forgui true if the string should use translations and 
-        *   special characters. 
+        * @param forgui true if the string should use translations and
+        *   special characters.
         */
        docstring const print(bool forgui) const;
 
@@ -60,8 +60,7 @@ public:
         * @return the action / LFUN_COMMAND_PREFIX / LFUN_UNKNOWN_ACTION
         */
        FuncRequest const &
-       lookup(KeySymbolPtr key,
-              key_modifier::state mod, KeySequence * seq) const;
+       lookup(KeySymbol const & key, KeyModifier mod, KeySequence * seq) const;
 
        ///
        typedef std::deque<KeySequence> Bindings;
@@ -77,7 +76,7 @@ public:
         *  The KeySymbol pointer is 0 is no key is found.
         *  [only used by the Qt/Mac frontend]
         */
-       std::pair<KeySymbol const *, key_modifier::state>
+       std::pair<KeySymbol, KeyModifier>
        find1keybinding(FuncRequest const & func) const;
 
 
@@ -87,18 +86,17 @@ public:
         * @param mod the modifiers
         */
        static std::string const printKeySym(KeySymbol const & key,
-                                            key_modifier::state mod);
+                                            KeyModifier mod);
 
-       typedef std::pair<key_modifier::state, key_modifier::state> modifier_pair;
+       typedef std::pair<KeyModifier, KeyModifier> ModifierPair;
 
-private:
        ///
        struct Key {
                /// Keysym
-               KeySymbolPtr code;
+               KeySymbol code;
 
                /// Modifier masks
-               modifier_pair mod;
+               ModifierPair mod;
 
                /// Keymap for prefix keys
                boost::shared_ptr<KeyMap> table;
@@ -107,6 +105,13 @@ private:
                FuncRequest func;
        };
 
+       ///
+       typedef std::vector<Key> Table;
+
+       Table::const_iterator begin() const { return table.begin(); }
+       Table::const_iterator end() const { return table.end(); }
+
+private:
        /**
         * Define an action for a key sequence.
         * @param r internal recursion level
@@ -125,8 +130,6 @@ private:
        /// is the table empty ?
        bool empty() const { return table.empty(); }
        ///
-       typedef std::vector<Key> Table;
-       ///
        Table table;
 };