osc.lua: make mouse bindings customizable

This adds several script-opts to configure what OSC buttons do when
clicked. It lets you restore the bindings present before they were
changed to call select.lua.

The script-opts are listed one per line in the manual to not make that
section huge.

skip_backward and skip_forward script-opts are omitted to lower the
script-opts number because they are only in box layout and undocumented.

I'm not sure if it's worth adding script-opts for the wheel on the
seekbar.

script-opts for the current and remaining time and fullscreen are not
added to not add more script messages.

Closes #6291 and #11878.
This commit is contained in:
Guido Cella
2024-10-17 13:22:33 +02:00
committed by Kacper Michajłow
parent 8e327f28b4
commit a80f535a6d
3 changed files with 176 additions and 92 deletions

View File

@@ -0,0 +1,4 @@
change several OSC mouse bindings to select.lua functions
add script-opts to configure what OSC buttons do when clicked
remove `osc-playlist_osd` script-opt and behave as if it was off by default; `playlist_osd=yes` can be replicated with `osc-playlist_prev_mbtn_left_command=playlist-prev; show-text ${playlist} 3000` and `osc-playlist_next_mbtn_left_command=playlist-next; show-text ${playlist} 3000`
remove `osc-chapters_osd` script-opt and behave as if it was off by default; `chapter_osd=yes` can be replicated with `osc-chapter_prev_mbtn_left_command=no-osd add chapter -1; show-text ${chapter-list} 3000` and `osc-chapter_next_mbtn_left_command=no-osd add chapter 1; show-text ${chapter-list} 3000`

View File

@@ -492,6 +492,74 @@ Configurable Options
Use display fps to calculate the interval between OSC redraws.
The following options configure what commands are run when the buttons are
clicked. ``mbtn_mid`` commands are also triggered with ``shift+mbtn_left``.
``title_mbtn_left_command=script-binding select/select-playlist; script-message-to osc osc-hide``
``title_mbtn_mid_command=show-text ${filename}``
``title_mbtn_right_command=script-binding stats/display-page-5``
``playlist_prev_mbtn_left_command=playlist-prev; show-text ${playlist} 3000``
``playlist_prev_mbtn_mid_command=show-text ${playlist} 3000``
``playlist_prev_mbtn_right_command=script-binding select/select-playlist; script-message-to osc osc-hide``
``playlist_next_mbtn_left_command=playlist-next; show-text ${playlist} 3000``
``playlist_next_mbtn_mid_command=show-text ${playlist} 3000``
``playlist_next_mbtn_right_command=script-binding select/select-playlist; script-message-to osc osc-hide``
``play_pause_mbtn_left_command=cycle pause``
``play_pause_mbtn_mid_command=``
``play_pause_mbtn_right_command=``
``chapter_prev_mbtn_left_command=no-osd add chapter -1; show-text ${chapter-list} 3000``
``chapter_prev_mbtn_mid_command=show-text ${chapter-list} 3000``
``chapter_prev_mbtn_right_command=script-binding select/select-chapter; script-message-to osc osc-hide``
``chapter_next_mbtn_left_command=no-osd add chapter 1; show-text ${chapter-list} 3000``
``chapter_next_mbtn_mid_command=show-text ${chapter-list} 3000``
``chapter_next_mbtn_right_command=script-binding select/select-chapter; script-message-to osc osc-hide``
``audio_track_mbtn_left_command=script-binding select/select-aid; script-message-to osc osc-hide``
``audio_track_mbtn_mid_command=show-text ${track-list/audio} 2000``
``audio_track_mbtn_right_command=show-text ${track-list/audio} 2000``
``audio_track_wheel_down_command=cycle audio``
``audio_track_wheel_up_command=cycle audio down``
``sub_track_mbtn_left_command=script-binding select/select-sid; script-message-to osc osc-hide``
``sub_track_mbtn_mid_command=show-text ${track-list/sub} 2000``
``sub_track_mbtn_right_command=show-text ${track-list/sub} 2000``
``sub_track_wheel_down_command=cycle sub``
``sub_track_wheel_up_command=cycle sub down``
``volume_mbtn_left_command=no-osd cycle mute``
``volume_mbtn_mid_command=``
``volume_mbtn_right_command=script-binding select/select-audio-device; script-message-to osc osc-hide``
``volume_wheel_down_command=add volume -5``
``volume_wheel_up_command=add volume 5``
Script Commands
~~~~~~~~~~~~~~~