Skip to content

Commit 87d4707

Browse files
committed
Update yesbot.py and README.md
- Added keyboard function
1 parent 68fd362 commit 87d4707

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ You will need:
7474

7575
![alt text](https://github.com/maxkung101/yes-bot/blob/master/preview_EN.png)
7676

77-
Press "Yes" to hear a voice saying "Yes." (This is Captain Falcon's voice from Super Smash Bros Melee, which is owned by Nintendo)
77+
Click "Yes" or press any key on the keyboard to hear a voice saying "Yes." (This is Captain Falcon's voice from Super Smash Bros Melee, which is owned by Nintendo)
7878

7979
Optional:
8080

yesbot.py

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
def sayYes():
77
yes_s.play()
88

9+
def key(event):
10+
yes_s.play()
11+
912
def shutdown():
1013
sounds.stop()
1114
app.destroy()
@@ -43,5 +46,6 @@ def shutdown():
4346
font = myFont
4447
)
4548
btn.pack(side = TOP)
49+
app.bind("<Key>", key)
4650
app.protocol("WM_DELETE_WINDOW", shutdown)
4751
app.mainloop()

0 commit comments

Comments
 (0)