diff --git a/pr-issue-61.md b/pr-issue-61.md new file mode 100644 index 0000000..c169bc3 --- /dev/null +++ b/pr-issue-61.md @@ -0,0 +1,16 @@ +## 📌 Description +Implemented functionality that allows the user to start the typing test by pressing the `Enter` (``) key instead of clicking the "Start Test" button with the mouse. This enables a more seamless and intuitive typing test workflow without taking hands off the keyboard. + +## 🔗 Related Issue +Closes #61 + +## 🛠 Changes Made +- Bound the `` key to check if `self.start_button` is enabled. +- Invokes `self.start_test()` if it is safe to start the test. + +## 📷 Screenshots (if applicable) + +## ✅ Checklist +- [x] I have tested my changes +- [x] I have linked the related issue +- [x] My code follows project guidelines diff --git a/typing_speed_test.py b/typing_speed_test.py index 81c95a0..f4a076f 100644 --- a/typing_speed_test.py +++ b/typing_speed_test.py @@ -139,6 +139,12 @@ def __init__(self): ) self.pause_button.grid(row=0, column=1, padx=10) + self.bind("", self.handle_enter) + + def handle_enter(self, event=None): + if self.start_button.cget("state") == "normal": + self.start_test() + # ====================== # STREAK TEXT # ======================