Closed ghost closed 2 years ago
https://github.com/po5/mpv_sponsorblock/blob/master/sponsorblock.lua#L560-L563
I suppose that remapping is officially supported and there's no need for further implementations.
I suppose that remapping is officially supported and there's no need for further implementations.
There's no easy way to restore the default mpv keybindings for g G h H
without redefining them again in input.conf
or editing sponsorblock.lua
. I had to replace them with nil
like this:
--- sponsorblock.lua
+++ sponsorblock.lua
@@ -558,10 +558,10 @@
end
mp.register_event("file-loaded", file_loaded)
-mp.add_key_binding("g", "set_segment", set_segment)
-mp.add_key_binding("G", "submit_segment", submit_segment)
-mp.add_key_binding("h", "upvote_segment", function() return vote("1") end)
-mp.add_key_binding("H", "downvote_segment", function() return vote("0") end)
+mp.add_key_binding(nil, "set_segment", set_segment)
+mp.add_key_binding(nil, "submit_segment", submit_segment)
+mp.add_key_binding(nil, "upvote_segment", function() return vote("1") end)
+mp.add_key_binding(nil, "downvote_segment", function() return vote("0") end)
-- Bindings below are for backwards compatibility and could be removed at any time
mp.add_key_binding(nil, "sponsorblock_set_segment", set_segment)
mp.add_key_binding(nil, "sponsorblock_submit_segment", submit_segment)
--input-default-bindings=no
--input-default-bindings=no
That kills all default mpv keybindings. This is not what most users want.
Complain on the mpv bug tracker to add an option to disable only script bindings.
I don't want to disable all script bindings, I want to disable the bindings for one script only, and maybe not even all of them.
There is no point in complaining about that on the mpv bugtracker as they will most likely say the plugin has to handle that, not mpv.
The only thing I could ask for there could be a function similar to mp.remove_key_binding()
that would only remove the binding to a key (e.g. "g"), not the definition of an bindable action itself (e.g. "set_segment"), so that the user would be able to unset some undesirable bindings (and maybe remap them to other keys, i.e., this is impossible with regular mp.remove_key_binding
) without losing the binding that the key was set to originally (e.g. loaded from default mpv keybindings or set by another plugin that got loaded earlier).
Default key bindings:
Can the mappings be disabled like keys in the mpv's
input.conf
?