From b94257f73f6d8a16a7c6bdb61c1eb3291bbf6d6e Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 2 Dec 2015 17:46:48 +0100 Subject: support for down, right, and p MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/rq.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/rq.c b/src/rq.c index cf05bd5..7ea61a6 100644 --- a/src/rq.c +++ b/src/rq.c @@ -211,6 +211,7 @@ static int display_file(int fd, int ttyfd, long rate) size_t size = 0; void *new; int saved_errno; + int timer_set = 1; char *s; char *end; char c; @@ -263,13 +264,17 @@ static int display_file(int fd, int ttyfd, long rate) SET_RATE; goto rewait; case 'p': /* P */ - ;/* TODO pause*/ - break; + if (timer_set) + memset(&interval, 0, sizeof(interval)); + else + SET_RATE; + setitimer(ITIMER_REAL, &interval, NULL); + timer_set ^= 1; + goto rewait; case 'q': /* Q */ goto done; case 'B': /* down */ case 'C': /* right */ - ;/* TODO next */ break; case 'A': /* up */ case 'D': /* left */ -- cgit v1.2.3-70-g09d2