Skip to content

Commit

Permalink
Add "+" and "-" commands to tune countdown value
Browse files Browse the repository at this point in the history
  • Loading branch information
MoonCactus committed Mar 22, 2021
1 parent f239ebc commit 3b4f893
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
6 changes: 6 additions & 0 deletions tty-clock.1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 11 additions & 1 deletion ttyclock.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* TTY-CLOCK Main file.
* Copyright © 2009-2018 tty-clock contributors
* Copyright © 2009-2021 tty-clock contributors
* Copyright © 2008 Martin Duquesnoy <[email protected]>
* All rights reserved.
*
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 3b4f893

Please sign in to comment.