Skip to content

Commit

Permalink
Only bind supported events
Browse files Browse the repository at this point in the history
Co-authored-by: MarkJoy <markjoy999@gmail.com>
Co-authored-by: tylandercasper <github.nospam@ibudesigns.com>
  • Loading branch information
3 people committed Jun 7, 2024
1 parent 56866d2 commit 5b3c9d6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion inputevent.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5b3c9d6

Please # to comment.