[core/input] do not throw on wrong event type

until now, if a module had registered callbacks, events for nonexistent
buttons caused the trigger mechanism to raise an exception.
This commit is contained in:
tobi-wan-kenobi 2020-04-02 16:21:07 +02:00
parent 2756f8fbb3
commit 0f6dfb3f1a
2 changed files with 6 additions and 1 deletions

View file

@ -38,7 +38,7 @@ def __invoke(event, callback):
if not callback: return
if not 'button' in event: return
for cb in callback.get(event['button']):
for cb in callback.get(event['button'], []):
if callable(cb):
cb(event)
else: