]> git.lyx.org Git - lyx.git/blobdiff - src/KeySequence.cpp
Change the "empty layout" to the "plain layout", to try to avoid confusion.
[lyx.git] / src / KeySequence.cpp
index 727c49d636883ffe6bc61681d885af53ac714ce6..5a7623b7f626fc86afb4c8f601596091525573f9 100644 (file)
 #include <config.h>
 
 #include "KeySequence.h"
-
-#include "gettext.h"
 #include "KeyMap.h"
-#include "lfuns.h"
 
-#include "frontends/KeySymbol.h"
+#include "support/gettext.h"
 
-using std::make_pair;
-using std::string;
+#include "frontends/KeySymbol.h"
 
+using namespace std;
 
 namespace lyx {
 
@@ -40,9 +37,8 @@ FuncRequest const & KeySequence::addkey(KeySymbol const & key,
        modifiers.push_back(make_pair(mod, nmod));
        sequence.push_back(key);
 
-       if (curmap) {
+       if (curmap)
                return curmap->lookup(key, mod, this);
-       }
 
        static FuncRequest unknown(LFUN_UNKNOWN_ACTION);
        return unknown;
@@ -143,12 +139,12 @@ docstring const KeySequence::print(outputFormat format) const
                        break;
                case BindFile:
                        KeyModifier mod = modifiers[i].first;
-                       if (mod & ShiftModifier)
-                               buf += "S-";
                        if (mod & ControlModifier)
                                buf += "C-";
                        if (mod & AltModifier)
                                buf += "M-";
+                       if (mod & ShiftModifier)
+                               buf += "S-";
                
                        buf += from_utf8(sequence[i].getSymbolName());
                        break;
@@ -194,4 +190,13 @@ void KeySequence::clear()
 }
 
 
+void KeySequence::removeKey()
+{
+       if (deleted_)
+               return;
+       sequence.pop_back();
+       modifiers.pop_back();
+}
+
+
 } // namespace lyx