Skip to content

Commit e13b850

Browse files
committed
Update code_solution.md
1 parent 23e61b9 commit e13b850

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

assignments/03-game-controller-discover/code_solution.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@ while True:
1515
if current_state is state_wait:
1616
keyboard.press(key) # Send our defined key as a command...
1717
print("button is pressed") #Print a confirmation in the serial monitor
18-
keyboard.release_all() # and release all keys again
1918

2019
current_state = state_button_is_pressed # Update our state
2120

2221
elif button.value is False:
2322
if current_state is state_button_is_pressed:
23+
keyboard.release_all() # and release all keys again
2424
print("button is released") # Print a confirmation in the serial monitor
25+
2526
current_state = state_wait # Reset the state
2627

2728
# Sleep briefly so keypress events occur at a human timescale.

0 commit comments

Comments
 (0)