X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FKeySequence.cpp;h=5a7623b7f626fc86afb4c8f601596091525573f9;hb=cca78e3c8ae27431323746abd64f9d7db017099d;hp=727c49d636883ffe6bc61681d885af53ac714ce6;hpb=36f7fcdee059e1db827f4686d574eb59d521d92c;p=lyx.git diff --git a/src/KeySequence.cpp b/src/KeySequence.cpp index 727c49d636..5a7623b7f6 100644 --- a/src/KeySequence.cpp +++ b/src/KeySequence.cpp @@ -13,16 +13,13 @@ #include #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