From 453cbff0edfe3e031184abeb730fd3b13008ad6b Mon Sep 17 00:00:00 2001 From: james <> Date: Fri, 29 Feb 2008 22:50:29 +0000 Subject: *** empty log message *** --- src/ansi.c | 14 +++++++++++--- src/cmd.c | 11 +++++++++++ src/prototypes.h | 2 ++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/ansi.c b/src/ansi.c index 970d353..ae89f61 100644 --- a/src/ansi.c +++ b/src/ansi.c @@ -10,6 +10,9 @@ static char rcsid[] = "$Id$"; /* * $Log$ + * Revision 1.37 2008/02/29 22:50:29 james + * *** empty log message *** + * * Revision 1.36 2008/02/28 22:00:42 james * *** empty log message *** * @@ -740,11 +743,16 @@ int ansi_key(ANSI *a,Context *c,int key) cmd_show_status (c->d, c); - if (c->d->active) - return cmd_key (c->d, c,a, key); - if (key == CMD_KEY) + if (c->d->active) { + if (key == CMD_KEY) + return cmd_deactivate (c->d, c); + }else { + return cmd_key (c->d, c,a, key); + } + } else if (key == CMD_KEY) return cmd_activate (c->d, c); + } return c->k->key (c->k, c, key); diff --git a/src/cmd.c b/src/cmd.c index 34dc2f4..c2d5e57 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -10,6 +10,9 @@ static char rcsid[] = "$Id$"; /* * $Log$ + * Revision 1.8 2008/02/29 22:50:29 james + * *** empty log message *** + * * Revision 1.7 2008/02/28 22:00:42 james * *** empty log message *** * @@ -136,6 +139,14 @@ cmd_key (Cmd * c, Context * ctx,ANSI *a, int key) } +int +cmd_deactivate (Cmd * c, Context * ctx) +{ + c->active = 0; + cmd_show_status (c, ctx); + return 0; +} + int cmd_activate (Cmd * c, Context * ctx) { diff --git a/src/prototypes.h b/src/prototypes.h index c378764..074f1a9 100644 --- a/src/prototypes.h +++ b/src/prototypes.h @@ -146,6 +146,8 @@ extern TTY *serial_open(char *path, int lock_mode); /* cmd.c */ extern int cmd_parse(Cmd *c, Context *ctx, ANSI *a, char *buf); extern void cmd_show_status(Cmd *c, Context *ctx); +extern int cmd_key(Cmd *c, Context *ctx, ANSI *a, int key); +extern int cmd_deactivate(Cmd *c, Context *ctx); extern int cmd_activate(Cmd *c, Context *ctx); extern void cmd_new_status(Cmd *c, Context *ctx, char *msg); extern Cmd *cmd_new(void); -- cgit v1.2.3