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