diff options
author | James Ross-Gowan <rossy@jrg.systems> | 2017-08-08 21:34:38 +1000 |
---|---|---|
committer | James Ross-Gowan <rossy@jrg.systems> | 2017-09-03 20:31:44 +1000 |
commit | 957e9a37db6611fe0879bd2097131df5e09afd47 (patch) | |
tree | b346371417acd0476a60e2c1ecde20c8548d14ba /etc/input.conf | |
parent | 449d9725c91af467b154817dfd0603d80ba7f00b (diff) | |
download | mpv-957e9a37db6611fe0879bd2097131df5e09afd47.tar.bz2 mpv-957e9a37db6611fe0879bd2097131df5e09afd47.tar.xz |
input: use mnemonic names for mouse buttons
mpv's mouse button numbering is based on X11 button numbering, which
allows for an arbitrary number of buttons and includes mouse wheel input
as buttons 3-6. This button numbering was used throughout the codebase
and exposed in input.conf, and it was difficult to remember which
physical button each number actually referred to and which referred to
the scroll wheel.
In practice, PC mice only have between two and five buttons and one or
two scroll wheel axes, which are more or less in the same location and
have more or less the same function. This allows us to use names to
refer to the buttons instead of numbers, which makes input.conf syntax a
lot easier to remember. It also makes the syntax robust to changes in
mpv's underlying numbering. The old MOUSE_BTNx names are still
understood as deprecated aliases of the named buttons.
This changes both the input.conf syntax and the MP_MOUSE_BTNx symbols in
the codebase, since I think both would benefit from using names over
numbers, especially since some platforms don't use X11 button numbering
and handle different mouse buttons in different windowing system events.
This also makes the names shorter, since otherwise they would be pretty
long, and it removes the high-numbered MOUSE_BTNx_DBL names, since they
weren't used.
Names are the same as used in Qt:
https://doc.qt.io/qt-5/qt.html#MouseButton-enum
Diffstat (limited to 'etc/input.conf')
-rw-r--r-- | etc/input.conf | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/etc/input.conf b/etc/input.conf index bf679b4017..172736cd32 100644 --- a/etc/input.conf +++ b/etc/input.conf @@ -28,13 +28,13 @@ # If this is enabled, treat all the following bindings as default. #default-bindings start -#MOUSE_BTN0 ignore # don't do anything -#MOUSE_BTN0_DBL cycle fullscreen # toggle fullscreen on/off -#MOUSE_BTN2 cycle pause # toggle pause on/off -#MOUSE_BTN3 seek 10 -#MOUSE_BTN4 seek -10 -#MOUSE_BTN5 add volume -2 -#MOUSE_BTN6 add volume 2 +#MBTN_LEFT ignore # don't do anything +#MBTN_LEFT_DBL cycle fullscreen # toggle fullscreen on/off +#MBTN_RIGHT cycle pause # toggle pause on/off +#WHEEL_UP seek 10 +#WHEEL_DOWN seek -10 +#WHEEL_LEFT add volume -2 +#WHEEL_RIGHT add volume 2 # Mouse wheels, touchpad or other input devices that have axes # if the input devices supports precise scrolling it will also scale the |