#pragma interface
#endif
+#include <vector>
#include "LString.h"
-#define KB_PREALLOC 16
-
class kb_keymap;
/// Holds a key sequence and the current and standard keymaps
///
kb_sequence() {
stdmap = curmap = 0;
- sequence = staticseq;
- modifiers = staticmod;
- length = 0;
- size = KB_PREALLOC;
- }
-
- ///
- ~kb_sequence() {
- if (sequence != staticseq) {
- delete sequence;
- delete modifiers;
- }
+ length = 0;
}
-
+
/** Add a key to the key sequence and look it up in the curmap
if the latter is defined. */
int addkey(unsigned int key, unsigned int mod, unsigned int nmod = 0);
/// Make length negative to mark the sequence as deleted
void delseq();
-
+
///
char getiso() const;
/** Array holding the current key sequence.
If sequence[length-1] < 0xff it can be used as ISO8859 char */
- unsigned int * sequence;
+ std::vector<unsigned int> sequence;
///
- unsigned int * modifiers;
+ std::vector<unsigned int> modifiers;
/// Current length of key sequence
int length;
-
-private:
- /// Static array preallocated for sequence
- unsigned int staticseq[KB_PREALLOC];
-
- ///
- unsigned int staticmod[KB_PREALLOC];
-
- /// Physically allocated storage size
- int size;
};
#endif