Skip to content

Commit dc5b082

Browse files
committed
added keyboard event recording in controlling keyboard tutorial
1 parent 285999e commit dc5b082

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

general/keyboard-controller/control_keyboard.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
# setting 0.1 seconds to wait between keypresses to look fancy
1919
keyboard.write("Python Programming is always fun!", delay=0.1)
2020

21+
# record all keyboard clicks until esc is clicked
22+
events = keyboard.record('esc')
23+
# play these events
24+
keyboard.play(events)
25+
2126
# remove all keyboard hooks in use
2227
keyboard.unhook_all()
2328

0 commit comments

Comments
 (0)