Add util function for key events
This commit is contained in:
parent
d294355a73
commit
f3f600892d
@ -4,6 +4,10 @@ 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
|
||||||
|
|
||||||
|
function Event.isKeyEvent(evt, key)
|
||||||
|
return evt[1] == "key" and (key == nil or evt[2] == key)
|
||||||
|
end
|
||||||
|
|
||||||
function Event.getClickParams(evt)
|
function Event.getClickParams(evt)
|
||||||
return evt[3], evt[4], evt[2]
|
return evt[3], evt[4], evt[2]
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user