Last active
July 11, 2024 03:55
-
-
Save washingweb/19c22ae94de4eaa5ba77b2795943398c to your computer and use it in GitHub Desktop.
MPV
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mp.add_forced_key_binding(";", "speed-control", function(kevent) | |
if kevent["event"] == "down" then | |
mp.command("set speed 2") | |
elseif kevent["event"] == "up" then | |
mp.command("set speed 1") | |
end | |
end, { | |
repeatable = false, | |
complex = true | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ~/.config/mpv/scripts/speed_control.lua | |
local speed_multiplier = 1.5 | |
mp.add_forced_key_binding(";", "speed-control", function(kevent) | |
if kevent["event"] == "down" then | |
local current_speed = mp.get_property_native("speed") | |
mp.set_property_native("speed", current_speed * speed_multiplier) | |
elseif kevent["event"] == "up" then | |
local current_speed = mp.get_property_native("speed") | |
mp.set_property_native("speed", current_speed / speed_multiplier) | |
end | |
end, { | |
repeatable = false, | |
complex = true | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment