From 762b6b196409c9e5b12325c1f166ff64ee6f2057 Mon Sep 17 00:00:00 2001 From: ny64 Date: Sat, 16 Jan 2021 17:55:13 +0100 Subject: [PATCH] Fixed restart --- README.md | 1 + src/input.c | 5 +++-- typist | Bin 22992 -> 22992 bytes 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cdbb02a..4ee9bb9 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,7 @@ To see all available options type typist --help or just | Binding | Function | |---------|----------| | Ctrl + q; Ctrl + c | Exit | +| Ctrl + r | Restart typing test | ### Tips diff --git a/src/input.c b/src/input.c index 6b89d7a..061f11d 100644 --- a/src/input.c +++ b/src/input.c @@ -79,13 +79,14 @@ void process_keypress() { CLR_SCREEN; CRS_POS_TOP; exit(0); -/* case CTRL_KEY('r'): + case CTRL_KEY('r'): refresh_screen(); parse_text(); print_text(); tt.pos = 0; + tt.print_index = 0; first_key_read = 0; - break;*/ + break; case 127: if (tt.pos == 0 || tt.is_new_page[tt.pos]) { break; diff --git a/typist b/typist index 45d1d8d750bd9568fbea66e98a3ac6259e6c94be..332fc0800fe423eaf70f3b862a0eb2647361c1c7 100755 GIT binary patch delta 3651 zcmZu!3s6+o8NO%XDqvt)mj#x$KuXXm50QtFNVFFgbf#L1j8-LNYNqB@G`pEh$7Uy4 zHQnBl$Q-OBO{#58Oms|27Yu45NLmP3J7Sr}7HhB-vkNq0A-X1*)9>8Fy=W(QhV%XB z`yb~&=l}1y%XuF;?<2ntBjJG-sNbRP$4*coh1tp`d&)V(_3po-M9buIuM?>WA=5i>_3iowcW|>S&BWR!X1@b;!9n($5 zeOBAT5O@9@N&1<>PKIIuN5hhqcuDFYkp0#mW9HKe^8_ur%yJT1d z9>d@X&UKb~f^O%|KnS>tC^&YP*4P#@xI+pKlo%@`HOKPCvMg zn|k(H*f^5;wdUNaJ9kS&mEXe5(@DJY8xR5`eA)fsLr#|p`G&s4II|(weeDvhN{GvC)0Ag*Ww*ps z`9sXKgj*quhVC6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