Skip to content

Instantly share code, notes, and snippets.

@blackarcher21
Created January 28, 2020 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blackarcher21/1a29d160d4836b7ba0dc273a0a5d4904 to your computer and use it in GitHub Desktop.
Save blackarcher21/1a29d160d4836b7ba0dc273a0a5d4904 to your computer and use it in GitHub Desktop.
mpv script - change window scale based on current scale, use ctrl+scroll to scale
local step = 0.050
function f_scale(x,y)
local scale = mp.get_property("current-window-scale")
if not scale then
return
end
mp.set_property("window-scale", scale + (x*y))
end
mp.add_key_binding("Ctrl+WHEEL_UP", "upscale", function() f_scale(step,1) end)
mp.add_key_binding("Ctrl+WHEEL_DOWN", "downscale", function() f_scale(step,-1) end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment