* fix #666

increase delay in the EventReader after notifying listeners

* update debug level for Context._creat_callbacks message
pull/669/head
jonasBoss 1 year ago committed by GitHub
parent 9e04df79ca
commit 7c561dde89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -107,7 +107,7 @@ class Context:
"""Add the notify method from all _handlers to self.callbacks."""
for input_config, handler_list in self._handlers.items():
input_match_hash = input_config.input_match_hash
logger.info("Adding NotifyCallback for %s", input_match_hash)
logger.debug("Adding NotifyCallback for %s", input_match_hash)
self._notify_callbacks[input_match_hash].extend(
handler.notify for handler in handler_list
)

@ -157,7 +157,8 @@ class EventReader:
# 4. The original event is forwarded (or whatever it is supposed to do)
# 5. Capitalized "A" is injected.
# So make sure to call the listeners before notifying the handlers.
await asyncio.sleep(0)
for _ in range(5):
await asyncio.sleep(0)
def forward(self, event: InputEvent) -> None:
"""Forward an event, which injects it unmodified."""

Loading…
Cancel
Save