X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FKeySequence.h;h=c5b9527578b29f669158aaea3457eae873bc6855;hb=ea6aed5b8bf38366aaa1eb15ce1b9f13de76987f;hp=e39d6e2d35633b821a978b950556492c764d8ef9;hpb=7afa73a0b338a5ab6acf2df7689afbfabc931880;p=lyx.git diff --git a/src/KeySequence.h b/src/KeySequence.h index e39d6e2d35..c5b9527578 100644 --- a/src/KeySequence.h +++ b/src/KeySequence.h @@ -10,10 +10,10 @@ * Full author contact details are available in file CREDITS. */ -#ifndef KB_SEQUENCE_H -#define KB_SEQUENCE_H +#ifndef KEYSEQUENCE_H +#define KEYSEQUENCE_H -#include "frontends/key_state.h" +#include "frontends/KeyModifier.h" #include "frontends/KeySymbol.h" #include @@ -45,9 +45,8 @@ public: * @param nmod which modifiers to mask out for equality test * @return the action matching this key sequence or LFUN_UNKNOWN_ACTION */ - FuncRequest const & - addkey(KeySymbol const & keysym, key_modifier::state mod, - key_modifier::state nmod = key_modifier::none); + FuncRequest const & addkey(KeySymbol const & keysym, KeyModifier mod, + KeyModifier nmod = NoModifier); /** * Add a sequence of keys from a string to the sequence @@ -62,13 +61,18 @@ public: */ size_t parse(std::string const & s); + enum outputFormat { + Portable, //< use a more portable format + ForGui, //< use platform specific translations and special characters + BindFile //< the format used in lyx bind files + }; + /** * Return the current sequence as a string. - * @param forgui true if the string should use translations and - * special characters. + * @param format output format * @see parse() */ - docstring const print(bool forgui) const; + docstring const print(outputFormat format) const; /** * Return the current sequence and available options as @@ -87,6 +91,9 @@ public: /// clear in full void clear(); + /// remove last key in sequence + void removeKey(); + bool deleted() const { return deleted_; } /// length of sequence @@ -105,11 +112,10 @@ private: */ Sequence sequence; - typedef std::pair - modifier_pair; + typedef std::pair ModifierPair; /// modifiers for keys in the sequence - std::vector modifiers; + std::vector modifiers; /// is keysequence deleted ? bool deleted_;