Wrapped `core.on_event` calls in `core.try`

This commit is contained in:
rxi 2020-05-09 08:38:51 +01:00
parent 22171fa802
commit a651d48e84
1 changed files with 3 additions and 2 deletions

View File

@ -333,12 +333,13 @@ function core.step()
elseif type == "textinput" and did_keymap then
did_keymap = false
else
did_keymap = core.on_event(type, a, b, c, d) or did_keymap
local _, res = core.try(core.on_event, type, a, b, c, d)
did_keymap = res or did_keymap
end
core.redraw = true
end
if mouse_moved then
core.on_event("mousemoved", mouse.x, mouse.y, mouse.dx, mouse.dy)
core.try(core.on_event, "mousemoved", mouse.x, mouse.y, mouse.dx, mouse.dy)
end
local width, height = renderer.get_size()