- return 0;
-}
-
-
-/* ---F+------------------------------------------------------------------ *\
- Function : kb_sequence::print
- Called by : [user]
- Purpose : print the currently defined sequence into a string
- Parameters: buf - string where the result goes
- maxlen - length of string (including '\0')
- when_defined - only print when sequence is real: length > 0.
- Returns : 0, if ok, -1 if string too long
-\* ---F------------------------------------------------------------------- */
-
-int kb_sequence::print(char *buf, int maxlen, bool when_defined) const
-{
- KeySym key;
- unsigned int mod;
- int len;
- int l = length;
- if ( l<0 && !when_defined ) l = -l;
-
- for(int i = 0; i < l; i++) {
- key = sequence[i];
- mod = modifiers[i] & 0xffff;
-
- len = printKeysym( key, mod, buf, maxlen ); // RVDK_PATCH_5
- buf += len;
- maxlen -= len;
-
- if ( len == 0 ) {
- *buf = '\0';
- return -1;
- }
-
- if(i+1<l && maxlen>1) { // append a blank
- *buf++ = ' ';
- maxlen--;
- }
- }
- *buf = '\0';
- return 0;
-}
-
-
-/* ---F+------------------------------------------------------------------ *\
- Function : kb_sequence::printOptions
- Called by : [user]
- Purpose : print the available key options from the current state in the
- sequence. RVDK_PATCH_5
- Parameters: buf - string where the result goes
- maxlen - length of string (including '\0')
- Returns : 0, if ok, -1 if string too long
-\* ---F------------------------------------------------------------------- */
-
-int kb_sequence::printOptions(char *buf, int maxlen) const
-{
- int len;
-
- print( buf, maxlen, true );
- len = strlen( buf );
- maxlen -= len;
- buf += len;
-
- if ( maxlen < 20 || !curmap ) return -1;
-#ifdef WITH_WARNINGS
-#warning reimplement kb_sequence using string
-#endif
- char s[20];
- strcpy(s,_(" options: "));
- strcpy( buf, s);
- buf += strlen(s);
- maxlen -= strlen(s);
-
- curmap->print(buf, maxlen);
- return 0;
-}
-
-
-/* ---F+------------------------------------------------------------------ *\
- Function : kb_sequence::delseq
- Called by : [user]
- Purpose : mark the sequence as deleted
- Parameters: none
- Returns : nothing
-\* ---F------------------------------------------------------------------- */
-
-void kb_sequence::delseq()
-{
- // negative length marks sequence as deleted, but we can still
- // print() it or retrieve the last char using getiso()
- length = -length;
-}
-
-
-/* ---F+------------------------------------------------------------------ *\
- Function : kb_sequence::getsym
- Called by : [user], getiso
- Purpose : get the keysym of the last key in sequence
- Parameters: none
- Returns : keysym
-\* ---F------------------------------------------------------------------- */
-
-KeySym kb_sequence::getsym()
-{
- int l = length;
- if(l==0) return NoSymbol;
- if(l<0) l = -l;
- return sequence[l-1];
-}
-
-
-/* ---F+------------------------------------------------------------------ *\
- Function : kb_sequence::getiso
- Called by : [user]
- Purpose : return iso character code of last key, if any
- Parameters: none
- Returns : iso code or 0 if none
-\* ---F------------------------------------------------------------------- */
-
-char kb_sequence::getiso()
-{
- int c = getsym();
-
- if(c > 0xff)
- return '\0';
- return (char)c;
-}
-
-
-/* ---F+------------------------------------------------------------------ *\
- Function : kb_sequence::reset
- Called by : [user]
- Purpose : reset sequence to initial state. RVDK_PATCH_5
- Parameters: none
- Returns : void
-\* ---F------------------------------------------------------------------- */
-
-void kb_sequence::reset()
-{
- delseq();
- curmap = stdmap;
- if ( length > 0 ) length = -length;
-}
-
-
-// === kb_keymap methods ==================================================