aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-12-02 17:46:48 +0100
committerMattias Andrée <maandree@operamail.com>2015-12-02 17:46:48 +0100
commitb94257f73f6d8a16a7c6bdb61c1eb3291bbf6d6e (patch)
tree42cbc1f78ff52862b0555f8cf9facba1b7d05ff5
parentsupport for +, -, and q (diff)
downloadread-quickly-b94257f73f6d8a16a7c6bdb61c1eb3291bbf6d6e.tar.gz
read-quickly-b94257f73f6d8a16a7c6bdb61c1eb3291bbf6d6e.tar.bz2
read-quickly-b94257f73f6d8a16a7c6bdb61c1eb3291bbf6d6e.tar.xz
support for down, right, and p
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rw-r--r--src/rq.c11
1 files changed, 8 insertions, 3 deletions
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 */