Skip to content

Commit

Permalink
Changed reset test keybinding on Stats Screen to Tab
Browse files Browse the repository at this point in the history
  • Loading branch information
Iipal committed May 2, 2021
1 parent c0b3aba commit 9479fca
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Typing speed test in terminal written in C++ using ncurses.
- Stats Screen:
- <kbd>Ctrl</kbd>+<kbd>C</kbd>, <kbd>Ctrl</kbd>+<kbd>D</kbd>, and <kbd>Esc</kbd>: Now closing the `typos`.
- <kbd>Ctrl</kbd>+<kbd>S</kbd>: Saves your typing test result to `./typos.log` file. By appending new test data to the end of the file and with the current local date at the top of each result.
- <kbd>Enter</kbd>: Restart the test.
- <kbd>Tab</kbd>: Restart the test.

> !! IMPORTANT !!; Because of reasons of handling the "Escape Sequences" the <kbd>Esc</kbd>-key by itself has a delay in 1 sec. My advice is to use <kbd>Ctrl</kbd>+<kbd>C</kbd>, and <kbd>Ctrl</kbd>+<kbd>D</kbd> keybindgds instead of <kbd>Esc</kbd> whatever it's possible. The <kbd>Esc</kbd> is not removed because for some peoples the <kbd>Esc</kbd>-key may be a more comfortable way to close the program.
Expand Down
6 changes: 2 additions & 4 deletions srcs/Print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ void Print::render_all(const Typing &text) {
Print::timer(Timer::get_remaining_seconds());
Print::input_word(text.get_prev_word(), text.get_word(),
text.get_next_word());
box(stdscr, 0, 0);
}

void Print::text(const Typing &text) { Print::text(text, text.get_length()); }
Expand Down Expand Up @@ -82,8 +83,6 @@ void Print::text(const Typing &text, size_t n_words) {
}

Print::_text_y = text_y;

box(stdscr, 0, 0);
}

void Print::text_delimiter(void) {
Expand Down Expand Up @@ -176,8 +175,7 @@ void Print::stats(const TypingStatsData &data) {
const int y = Print::get_stats_y();

const char *msg1 = "YOU TIMED OUT";
const char *msg2 =
"Restart: `Enter` | Exit: `Ctrl+C` | Save Result: `Ctrl+S`";
const char *msg2 = "Restart: `Tab` | Exit: `Ctrl+C` | Save Result: `Ctrl+S`";

Colorize::cmvprintw(COLORIZE_OK, y, Print::get_center_x(strlen(msg1) - 1),
msg1);
Expand Down
2 changes: 1 addition & 1 deletion srcs/Timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void Timer::break_the_words(void) {
break;
}

case TypingKeys::KEY_NEW_LINE: {
case TypingKeys::KEY_TAB: {
clean_lines();
Timer::_typing->reset();
Timer::_typing->reset_stats();
Expand Down

0 comments on commit 9479fca

Please sign in to comment.