4 * Copyright 2001 the LyX Team
5 * Read the file COPYING
18 #include "commandtags.h"
22 /// Holds a key sequence and the current and standard keymaps
25 friend class kb_keymap;
28 kb_sequence(kb_keymap * std, kb_keymap * cur)
29 : stdmap(std), curmap(cur), length_(0), deleted_(false) {}
34 * Add a key to the key sequence and look it up in the curmap
35 * if the latter is defined.
36 * @param mod modifier mask
37 * @return the action matching this key sequence or LFUN_UNKNOWN_ACTION
39 kb_action addkey(unsigned int key, unsigned int mod);
42 * Add a sequence of keys from a string to the sequence
43 * @return string::npos if OK, else error position in string
45 * Keys in the string must be separated with whitespace;
46 * Use the keysym names used by XStringToKeysym
47 * Prefixes are S-, C-, M- for shift, control, meta
49 string::size_type parse(string const & s);
52 * Return the current sequence as a string.
55 string const print() const;
58 * Return the current sequence and available options as
59 * a string. No options are added if no curmap kb map exists.
61 string const printOptions() const;
63 /// Mark the sequence as deleted.
66 /// Return the ISO value of the last keysym in sequence, or 0
69 /// Reset sequence to become "deleted"
75 bool deleted() const {
79 /// length of sequence
80 std::vector<unsigned int>::size_type length() const {
84 /// Keymap to use if a new sequence is starting
87 /// Keymap to use for the next key
91 /// get the keysym of last in sequence
92 unsigned int getsym() const;
95 * Array holding the current key sequence.
96 * If sequence[length-1] < 0xff it can be used as ISO8859 char
98 std::vector<unsigned int> sequence;
100 /// modifiers for keys in the sequence
101 std::vector<unsigned int> modifiers;
103 /// Current length of key sequence
104 std::vector<unsigned int>::size_type length_;
106 /// is keysequence deleted ?