From 5b3c9d6ca6c3806efe74a1bccf7e627383b2afda Mon Sep 17 00:00:00 2001 From: natural-harmonia-gropius <50797982+natural-harmonia-gropius@users.noreply.github.com> Date: Fri, 7 Jun 2024 11:14:10 +0800 Subject: [PATCH] Only bind supported events Co-authored-by: MarkJoy Co-authored-by: tylandercasper --- inputevent.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/inputevent.lua b/inputevent.lua index 26033d6..7efa452 100644 --- a/inputevent.lua +++ b/inputevent.lua @@ -20,6 +20,13 @@ local event_pattern = { { to = "release", from = "up", length = 1 }, } +local supported_events = { + ["repeat"] = true +} +for _, value in ipairs(event_pattern) do + supported_events[value.to] = true +end + -- https://mpv.io/manual/master/#input-command-prefixes local prefixes = { "osd-auto", "no-osd", "osd-bar", "osd-msg", "osd-msg-bar", "raw", "expand-properties", "repeatable", "async", "sync" } @@ -367,7 +374,7 @@ function bind_from_conf(conf) local events = table.filter(comments, function(i, v) return v:match("^@") end) if events and #events > 0 then local event = events[1]:match("^@(.*)"):trim() - if event and event ~= "" then + if event and event ~= "" and supported_events[event] then if kv[key] == nil then kv[key] = {} end