Coverage for src/countdown/keys.py: 100%
10 statements
« prev ^ index » next coverage.py v7.11.1, created at 2026-03-27 20:23 -0700
« prev ^ index » next coverage.py v7.11.1, created at 2026-03-27 20:23 -0700
1"""Keyboard input interpretation."""
4def is_pause_key(key):
5 """Check if the given key is a pause/resume key (Space, p, k, Enter)."""
6 return key in (" ", "p", "k", "\r", "\n")
9def is_time_adjust_key(key):
10 """Check if the given key is a time adjustment key (+, =, -)."""
11 return key in ("+", "=", "-")
14def get_time_adjustment(key):
15 """Return the time adjustment in seconds for the given key."""
16 if key in ("+", "="):
17 return 30 # Add 30 seconds
18 elif key == "-":
19 return -30 # Subtract 30 seconds
20 return 0