From 14153522b65e4ac949e6d83ed27f97bae2f25eb1 Mon Sep 17 00:00:00 2001 From: Gabriel Tofvesson Date: Thu, 14 Nov 2024 02:35:07 +0000 Subject: [PATCH] Get key event values --- gfx/event.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gfx/event.lua b/gfx/event.lua index 66c25ae..887512f 100644 --- a/gfx/event.lua +++ b/gfx/event.lua @@ -1,13 +1,17 @@ local Event = {} -function Event.isClickEvent(evt) - return evt[1] == "monitor_touch" or evt[1] == "mouse_click" -end - function Event.isKeyEvent(evt, key) return evt[1] == "key" and (key == nil or evt[2] == key) end +function Event.getKeyParams(evt) + return evt[2], evt[3] +end + +function Event.isClickEvent(evt) + return evt[1] == "monitor_touch" or evt[1] == "mouse_click" +end + function Event.getClickParams(evt) return evt[3], evt[4], evt[2] end