[core] make bumblebee more reactive

- set default delay to 0
- split input reading into 2 threads
- get rid of polling
This commit is contained in:
tobi-wan-kenobi 2021-03-13 14:09:42 +01:00
parent 868502d62e
commit 9f89e3a657
3 changed files with 45 additions and 40 deletions

View file

@ -8,6 +8,13 @@ def register(event, callback, *args, **kwargs):
__callbacks.setdefault(event, []).append(cb)
def register_exclusive(event, callback, *args, **kwargs):
cb = callback
if args or kwargs:
cb = lambda: callback(*args, **kwargs)
__callbacks[event] = [cb]
def unregister(event):
if event in __callbacks:
del __callbacks[event]