X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fansi.c;h=970d353a2670d874d0f59ce80f04d897bd52da5a;hb=0811309bdec5ebb179d6056005f94c585b8fc8fd;hp=408efd4429f27ce72e0e1ddf41cd29cc2dc41835;hpb=caf94d0d1e0761964085d873603dfd77faa7c4fd;p=sympathy.git diff --git a/src/ansi.c b/src/ansi.c index 408efd4..970d353 100644 --- a/src/ansi.c +++ b/src/ansi.c @@ -10,6 +10,12 @@ static char rcsid[] = "$Id$"; /* * $Log$ + * Revision 1.36 2008/02/28 22:00:42 james + * *** empty log message *** + * + * Revision 1.35 2008/02/28 16:57:51 james + * *** empty log message *** + * * Revision 1.34 2008/02/27 09:42:53 james * *** empty log message *** * @@ -725,6 +731,26 @@ ansi_terminal_reset (ANSI * a) ansi_move (a, p); } + +int ansi_key(ANSI *a,Context *c,int key) +{ + + if (!c->d) + return c->k->key (c->k, c, key); + + cmd_show_status (c->d, c); + + if (c->d->active) + return cmd_key (c->d, c,a, key); + + if (key == CMD_KEY) + return cmd_activate (c->d, c); + + + return c->k->key (c->k, c, key); +} + + static void ansi_flush_escape (ANSI * a, Context * c) { @@ -733,7 +759,7 @@ ansi_flush_escape (ANSI * a, Context * c) for (i = 0; i < p->escape_ptr; ++i) { - keydis_key (c->k, c, p->escape_buf[i]); + ansi_key (a, c, p->escape_buf[i]); } p->escape_ptr = 0; @@ -752,11 +778,11 @@ ansi_parse_deckey (ANSI * a, Context * c) if ((p->escape_buf[2] >= 'A') || (p->escape_buf[2] <= 'Z')) { - keydis_key (c->k, c, KEY_UP + (p->escape_buf[2] - 'A')); + ansi_key (a, c, KEY_UP + (p->escape_buf[2] - 'A')); } else if ((p->escape_buf[2] >= 'a') || (p->escape_buf[2] <= 'z')) { - keydis_key (c->k, c, KEY_154 + (p->escape_buf[2] - 'a')); + ansi_key (a, c, KEY_154 + (p->escape_buf[2] - 'a')); } else { @@ -779,7 +805,7 @@ ansi_parse_ansikey (ANSI * a, Context * c) } if ((p->escape_buf[2] >= '0') || (p->escape_buf[2] <= '9')) { - keydis_key (c->k, c, KEY_180 + (p->escape_buf[2] - '0')); + ansi_key (a, c, KEY_180 + (p->escape_buf[2] - '0')); } else { @@ -892,7 +918,7 @@ ansi_parse_char (ANSI * a, Context * c, int ch) } else { - keydis_key (c->k, c, ch); + ansi_key (a, c, ch); } } @@ -948,6 +974,7 @@ ansi_update (ANSI * a, Context * c) { ansi_history (a, c->h); ansi_draw (a, &c->v->crt); + tty_length(a->terminal,c->v->crt.size.y); } static void