Add char event utils

This commit is contained in:
Gabriel Tofvesson 2024-11-14 03:02:31 +00:00
parent 1456dc332f
commit 5eafe25b1a

View File

@ -8,6 +8,14 @@ function Event.getKeyParams(evt)
return evt[2], evt[3] return evt[2], evt[3]
end end
function Event.isCharEvent(evt, char)
return evt[1] == "char" and (key == nil or evt[2] == key)
end
function Event.getCharValue(evt)
return evt[2]
end
function Event.isClickEvent(evt) function Event.isClickEvent(evt)
return evt[1] == "monitor_touch" or evt[1] == "mouse_click" return evt[1] == "monitor_touch" or evt[1] == "mouse_click"
end end