- 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 ==================================================
-
-// This binds a key to an action
-int kb_keymap::bind(char const *seq, int action)
-{
- kb_sequence k;
-
- int res = k.parse(seq);
- if (!res) {
- defkey(&k, action);
- } else
- lyxerr.debug(string("Parse error at position ") + tostr(res) +
- " in key sequence '" + seq + "'.", Error::KBMAP);