-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
various: define builtin options and key bindings for images
This makes mpv a good image viewer out of the box, as it is currently hard to setup. It adds a builtin image conditional profile that users can extend in mpv.conf. It is written to not restore and reapply the options on each image change, because that is slow for certain options (e.g. --d3d11-flip=no restarts the VO), and causes visible flicker when options like gamma are unapplied before changing image and reapplied on the next image. But it still restores the previous options after switching to a video or audio file. etc/image-input.conf defines default key bindings for image, and ~/.config/mpv/image-input.conf can override them. sxiv is the main inspiration for the default key bindings. Files called image-input.conf are added to an input section called image, and builtin.conf enables it for images and disables it for non-images. Because enable-section and disable-section are only called in builtin.conf, they can be replaced with a different mechanism when deprecated input sections are removed without a breaking change.
- Loading branch information
1 parent
68d9ed2
commit e5a64a1
Showing
7 changed files
with
236 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# Image key bindings | ||
# | ||
# Location of user-defined bindings: ~/.config/mpv/image-input.conf | ||
# | ||
# Lines starting with # are comments. Use SHARP to assign the # key. | ||
# Copy this file and uncomment and edit the bindings you want to change. | ||
# | ||
# List of commands and further details: DOCS/man/input.rst | ||
# List of special keys: --input-keylist | ||
# Keybindings testing mode: mpv --input-test --force-window --idle | ||
# | ||
# Use 'ignore' to unbind a key fully (e.g. 'ctrl+a ignore'). | ||
# | ||
# Strings need to be quoted and escaped: | ||
# KEY show-text "This is a single backslash: \\ and a quote: \" !" | ||
# | ||
# You can use modifier-key combinations like Shift+Left or Ctrl+Alt+x with | ||
# the modifiers Shift, Ctrl, Alt and Meta (may not work on the terminal). | ||
# | ||
# The default keybindings are hardcoded into the mpv binary. | ||
# You can disable them completely with: --no-input-default-bindings | ||
|
||
#LEFT script-binding/positioning pan-x -0.2 # pan left | ||
#DOWN script-binding/positioning pan-y 0.2 # pan down | ||
#UP script-binding/positioning pan-y -0.2 # pan up | ||
#RIGHT script-binding/positioning pan-x 0.2 # pan right | ||
#h script-binding/positioning pan-x -0.2 # pan left | ||
#j script-binding/positioning pan-y 0.2 # pan down | ||
#k script-binding/positioning pan-y -0.2 # pan up | ||
#l script-binding/positioning pan-x 0.2 # pan right | ||
#Shift+LEFT script-binding/positioning pan-x -0.02 # pan left slowly | ||
#Shift+DOWN script-binding/positioning pan-y 0.02 # pan down slowly | ||
#Shift+UP script-binding/positioning pan-y -0.02 # pan up slowly | ||
#Shift+RIGHT script-binding/positioning pan-x 0.02 # pan right slowly | ||
#H script-binding/positioning pan-x -0.02 # pan left slowly | ||
#J script-binding/positioning pan-y 0.02 # pan down slowly | ||
#K script-binding/positioning pan-y -0.02 # pan up slowly | ||
#L script-binding/positioning pan-x 0.02 # pan right slowly | ||
|
||
# Recommened on a touchpad: | ||
# WHEEL_UP script-binding/positioning pan-y -0.2 # pan up | ||
# WHEEL_DOWN script-binding/positioning pan-y 0.2 # pan down | ||
# WHEEL_LEFT script-binding/positioning pan-x -0.2 # pan left | ||
# WHEEL_RIGHT script-binding/positioning pan-x 0.2 # pan right | ||
|
||
#Ctrl+LEFT no-osd set video-align-x -1 # align to the left | ||
#Ctrl+DOWN no-osd set video-align-y 1 # align to the bottom | ||
#Ctrl+UP no-osd set video-align-y -1 # align to the top | ||
#Ctrl+RIGHT no-osd set video-align-x 1 # align to the right | ||
#Ctrl+h no-osd set video-align-x -1 # align to the left | ||
#Ctrl+j no-osd set video-align-y 1 # align to the bottom | ||
#Ctrl+k no-osd set video-align-y -1 # align to the top | ||
#Ctrl+l no-osd set video-align-x 1 # align to the right | ||
|
||
= add video-zoom 0.25 # zoom in | ||
- add video-zoom -0.25 # zoom out | ||
+ add video-zoom 0.05 # zoom in slowly | ||
_ add video-zoom -0.05 # zoom out slowly | ||
0 no-osd set video-zoom 0; no-osd set panscan 0 # reset zoom | ||
|
||
#u no-osd cycle-values video-unscaled yes no; no-osd set video-zoom 0; no-osd set panscan 0 # toggle scaling the image to the window. | ||
|
||
#o no-osd set panscan 1; no-osd set video-unscaled no; no-osd set video-zoom 0 # fill black bars | ||
|
||
#MBTN_RIGHT script-binding positioning/drag-to-pan # pan around the clicked point | ||
|
||
#WHEEL_UP script-message cursor-centric-zoom 0.1 # zoom in towards the cursor | ||
#WHEEL_DOWN script-message cursor-centric-zoom -0.1 # zoom out towards the cursor | ||
|
||
#s cycle-values image-display-duration 5 inf; no-osd set video-zoom 0; no-osd set panscan 0; no-osd set video-unscaled no # toggle slideshow | ||
|
||
#n repeatable playlist-next # go to the next file | ||
#p repeatable playlist-prev # go to the previous file | ||
#N playlist-next-playlist # go to the next sub-playlist | ||
#P playlist-prev-playlist # go to the previous sub-playlist | ||
|
||
#g-g no-osd set playlist-pos 0 # go to the first playlist entry | ||
#G no-osd set playlist-pos-1 ${playlist-count} # go to the last playlist entry | ||
|
||
] no-osd add playlist-pos 10 # go 10 playlist entries forwards | ||
[ no-osd add playlist-pos -10 # go 10 playlist entries backwards | ||
|
||
#r cycle-values video-rotate 270 180 90 0 # rotate counterclockwise | ||
#R cycle-values video-rotate 270 180 90 0 # rotate counterclockwise | ||
#t cycle-values video-rotate 90 180 270 0 # rotate clockwise | ||
#v cycle-values video-rotate 0 180 # rotate by 180 degrees |
This file contains 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
This file contains 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
This file contains 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