From 3b4f8930bf16a9f52af69d9f80d30a464d3a1101 Mon Sep 17 00:00:00 2001 From: "Jeremie Francois (on omega)" Date: Mon, 22 Mar 2021 08:57:08 +0100 Subject: [PATCH] Add "+" and "-" commands to tune countdown value --- tty-clock.1 | 6 ++++++ ttyclock.c | 12 +++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/tty-clock.1 b/tty-clock.1 index 2b98ff5..9c023c1 100644 --- a/tty-clock.1 +++ b/tty-clock.1 @@ -61,6 +61,12 @@ Pause and resume clock, timer or countdown. Z Restart the timer or countdown (see \fB-p\fR below). This command has no effect on regular time display. .TP ++ +Add one minute to the timer/countdown. +.TP +- +Subtract one minute to the timer/countdown. +.TP Q Quit. .SH "OPTIONS" diff --git a/ttyclock.c b/ttyclock.c index 9712087..a692a0c 100644 --- a/ttyclock.c +++ b/ttyclock.c @@ -1,6 +1,6 @@ /* * TTY-CLOCK Main file. - * Copyright © 2009-2018 tty-clock contributors + * Copyright © 2009-2021 tty-clock contributors * Copyright © 2008 Martin Duquesnoy * All rights reserved. * @@ -631,6 +631,16 @@ key_event(void) ttyclock.lt_paused = ttyclock.lt; break; + case '+': + if(ttyclock.lt_origin) + ttyclock.lt_origin += 60; + break; + + case '-': + if(ttyclock.lt_origin) + ttyclock.lt_origin -= 60; + break; + case ' ': if(!ttyclock.lt_paused) ttyclock.lt_paused = ttyclock.lt;