You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromsshkeyboardimportlisten_keyboard, stop_listeningclassStopException(Exception):
passdefkeypress(key):
ifkey=='s':
# stop_listening()raiseStopException()
print(key)
whileTrue:
print('listening from now')
try:
listen_keyboard(on_press=keypress, until='enter', sequential=True, delay_second_char=0, delay_other_chars=0)
exceptStopException:
# stop_listening()print('listening requested to be stopped')
As soon as s is pressed for the first time and the loop reiterates, I am getting an AssertionError: Only one listener allowed at a time. It doesn't matter which of or even if both of the stop_listening() calls are uncommented.
In the first place, I would expect an exception to stop the listening anyway.
But I am even manually requesting stop_listening(), yet listen_keyboard cannot be called again because somehow it thinks that it is already listening.
AssertionError: Only one listener allowed at a time
The text was updated successfully, but these errors were encountered:
As soon as
s
is pressed for the first time and the loop reiterates, I am getting an AssertionError: Only one listener allowed at a time. It doesn't matter which of or even if both of thestop_listening()
calls are uncommented.In the first place, I would expect an exception to stop the listening anyway.
But I am even manually requesting
stop_listening()
, yetlisten_keyboard
cannot be called again because somehow it thinks that it is already listening.The text was updated successfully, but these errors were encountered: