From c61fcd73d0d9adb875697c9e57f8c4238bf0b246 Mon Sep 17 00:00:00 2001 From: Guido Cella Date: Thu, 12 Dec 2024 20:46:18 +0100 Subject: [PATCH 1/3] osc.lua: open the playlist selector when right clicking playlist arrows - It makes more sense to select a playlist entry from the buttons that navigate the playlist than from the title - Provides different bindings for right and middle click - Mirrors chapter button bindings --- DOCS/man/osc.rst | 8 ++++---- etc/restore-osc-bindings.conf | 3 +++ player/lua/osc.lua | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/DOCS/man/osc.rst b/DOCS/man/osc.rst index ec619af0ab211..44ed7eb53b002 100644 --- a/DOCS/man/osc.rst +++ b/DOCS/man/osc.rst @@ -31,17 +31,17 @@ The Interface pl prev ============= ================================================ left-click play previous file in playlist - right-click show the playlist shift+L-click show the playlist middle-click show the playlist + right-click open the playlist selector ============= ================================================ pl next ============= ================================================ left-click play next file in playlist - right-click show the playlist shift+L-click show the playlist middle-click show the playlist + right-click open the playlist selector ============= ================================================ title @@ -505,13 +505,13 @@ clicked. ``mbtn_mid`` commands are also triggered with ``shift+mbtn_left``. ``playlist_prev_mbtn_mid_command=show-text ${playlist} 3000`` -``playlist_prev_mbtn_right_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=show-text ${playlist} 3000`` +``playlist_next_mbtn_right_command=script-binding select/select-playlist; script-message-to osc osc-hide`` ``title_mbtn_left_command=script-binding stats/display-page-5`` diff --git a/etc/restore-osc-bindings.conf b/etc/restore-osc-bindings.conf index 409f44493de9f..af530ffeb66d1 100644 --- a/etc/restore-osc-bindings.conf +++ b/etc/restore-osc-bindings.conf @@ -17,6 +17,9 @@ chapter_prev_mbtn_left_command=no-osd add chapter -1; show-text ${chapter-list} chapter_next_mbtn_left_command=no-osd add chapter 1; show-text ${chapter-list} 3000 # restore behavior before select.lua usage +playlist_prev_mbtn_right_command=show-text ${playlist} 3000 +playlist_next_mbtn_right_command=show-text ${playlist} 3000 + title=${media-title} title_mbtn_left_command=show-text "${!playlist-count==1:[${playlist-pos-1}/${playlist-count}] }${media-title}" title_mbtn_right_command=show-text ${filename} diff --git a/player/lua/osc.lua b/player/lua/osc.lua index 1b3b6eb0c9c02..88cff2b04c9af 100644 --- a/player/lua/osc.lua +++ b/player/lua/osc.lua @@ -73,11 +73,11 @@ local user_opts = { -- luacheck: max line length playlist_prev_mbtn_left_command = "playlist-prev", playlist_prev_mbtn_mid_command = "show-text ${playlist} 3000", - playlist_prev_mbtn_right_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", playlist_next_mbtn_mid_command = "show-text ${playlist} 3000", - playlist_next_mbtn_right_command = "show-text ${playlist} 3000", + playlist_next_mbtn_right_command = "script-binding select/select-playlist; script-message-to osc osc-hide", title_mbtn_left_command = "script-binding stats/display-page-5", title_mbtn_mid_command = "show-text ${filename}", From a3bb0c92a58108629f736790fab02aa1fec42396 Mon Sep 17 00:00:00 2001 From: Guido Cella Date: Thu, 12 Dec 2024 20:49:09 +0100 Subject: [PATCH 2/3] osc.lua: show the full path when right clicking the title Right clicking playlist arrows already opens the playlist selector so bind something else to right clicking the title. Make it show the full path which is useful but not bound anywhere on either the keyboard or the OSC. --- DOCS/man/osc.rst | 4 ++-- player/lua/osc.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DOCS/man/osc.rst b/DOCS/man/osc.rst index 44ed7eb53b002..521dc7da52057 100644 --- a/DOCS/man/osc.rst +++ b/DOCS/man/osc.rst @@ -51,7 +51,7 @@ title ============= ================================================ left-click show file and track info middle-click show the filename - right-click open the playlist selector + right-click show the path ============= ================================================ cache @@ -517,7 +517,7 @@ clicked. ``mbtn_mid`` commands are also triggered with ``shift+mbtn_left``. ``title_mbtn_mid_command=show-text ${filename}`` -``title_mbtn_right_command=script-binding select/select-playlist; script-message-to osc osc-hide`` +``title_mbtn_right_command=show-text ${path}`` ``play_pause_mbtn_left_command=cycle pause`` diff --git a/player/lua/osc.lua b/player/lua/osc.lua index 88cff2b04c9af..72d3948da6351 100644 --- a/player/lua/osc.lua +++ b/player/lua/osc.lua @@ -81,7 +81,7 @@ local user_opts = { title_mbtn_left_command = "script-binding stats/display-page-5", title_mbtn_mid_command = "show-text ${filename}", - title_mbtn_right_command = "script-binding select/select-playlist; script-message-to osc osc-hide", + title_mbtn_right_command = "show-text ${path}", play_pause_mbtn_left_command = "cycle pause", play_pause_mbtn_mid_command = "", From 14755dbe2ca390cb49a0fd007eeb132f868c89c5 Mon Sep 17 00:00:00 2001 From: Guido Cella Date: Thu, 12 Dec 2024 20:54:51 +0100 Subject: [PATCH 3/3] DOCS/man/osc: sort mouse bindings consistently Always list in the order left shift+L middle right click. --- DOCS/man/osc.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/DOCS/man/osc.rst b/DOCS/man/osc.rst index 521dc7da52057..a0cb7a7b113c6 100644 --- a/DOCS/man/osc.rst +++ b/DOCS/man/osc.rst @@ -50,6 +50,7 @@ title ============= ================================================ left-click show file and track info + shift+L-click show the filename middle-click show the filename right-click show the path ============= ================================================ @@ -66,15 +67,17 @@ play skip back ============= ================================================ left-click go to beginning of chapter / previous chapter - right-click open the chapter selector shift+L-click show chapters + middle-click show chapters + right-click open the chapter selector ============= ================================================ skip frwd ============= ================================================ left-click go to next chapter - right-click open the chapter selector shift+L-click show chapters + middle-click show chapters + right-click open the chapter selector ============= ================================================ time elapsed