2 /* ======================================================================= *\
3 File : kbmap.h, kbmap.h,v 1.3 1996/12/10 04:35:57 larsbj Exp
4 Author : chb, 30.Oct.1995
6 Purpose: class definitions for XKeyEvent keymap handling
7 \* ==================================================================== */
20 #define KB_PREALLOC 16
25 /// Holds a key sequence and the current and standard keymaps
33 modifiers = staticmod;
44 if (sequence != staticseq) {
51 /** Add a key to the key sequence and look it up in the curmap
52 if the latter is defined. */
53 int addkey(unsigned int key, unsigned int mod, unsigned int nmod = 0);
56 int print(string & buf, bool when_defined = false) const;
59 int printOptions(string & buf) const;
61 /// Make length negative to mark the sequence as deleted
68 unsigned int getsym() const;
74 int parse(string const & s);
76 /// Keymap to use if a new sequence is starting
79 /// Keymap to use for the next key
82 /** Array holding the current key sequence.
83 If sequence[length-1] < 0xff it can be used as ISO8859 char */
85 unsigned int * sequence;
87 std::vector<unsigned int> sequence;
92 unsigned int * modifiers;
94 std::vector<unsigned int> modifiers;
97 /// Current length of key sequence
101 /// Static array preallocated for sequence
102 unsigned int staticseq[KB_PREALLOC];
105 unsigned int staticmod[KB_PREALLOC];
107 /// Physically allocated storage size