History

osc.lua: open select.lua by clicking buttons

8bf5548 added mouse support to the console's select menu, so open it from OSC buttons. Left click on the title opens the playlist selector and showing the stats is moved to right click. Right click on chapter buttons opens the chapter selector. Left click on track buttons opens the track selectors because seeing which track you're selecting beforehand is useful. Fixes #10621.

Guido Cella committed 2 years ago

Commit cd2acb41 parent 68e2b512 files · +38 −26Browse files

Unified · Split

2 files
  1. DOCS/man/osc.rst +12 −9
  2. player/lua/osc.lua +26 −17
DOCS/man/osc.rst+12−9
@@ -31,15 +31,17 @@ The Interface · 30 unmodified lines
31pl prev31pl prev
32 ============= ================================================32 ============= ================================================
33 left-click play previous file in playlist33 left-click play previous file in playlist
34 right-click show playlist34 right-click open the playlist selector
35 shift+L-click show playlist35 shift+L-click show the playlist
36 middle-click show the playlist
36 ============= ================================================37 ============= ================================================
37 38
38pl next39pl next
39 ============= ================================================40 ============= ================================================
40 left-click play next file in playlist41 left-click play next file in playlist
41 right-click show playlist42 right-click open the playlist selector
42 shift+L-click show playlist43 shift+L-click show the playlist
44 middle-click show the playlist
43 ============= ================================================45 ============= ================================================
44 46
45title47title
@@ -47,9 +49,8 @@ title · 1 unmodified line
47 title, or the target chapter name while hovering the seekbar.49 title, or the target chapter name while hovering the seekbar.
48 50
49 ============= ================================================51 ============= ================================================
50 left-click show file and track info52 left-click open the playlist selector
51 middle-click show filename53 middle-click show the filename
52 shift+L-click show filename
53 right-click show file and track info54 right-click show file and track info
54 ============= ================================================55 ============= ================================================
55 56
@@ -102,15 +103,17 @@ audio and sub · 46 unmodified lines
102 | Displays selected track and amount of available tracks103 | Displays selected track and amount of available tracks
103 104
104 ============= ================================================105 ============= ================================================
105 left-click cycle audio/sub tracks forward106 left-click open the audio/sub track selector
106 right-click cycle audio/sub tracks backwards
107 shift+L-click show available audio/sub tracks107 shift+L-click show available audio/sub tracks
108 middle-click show available audio/sub tracks
109 right-click show available audio/sub tracks
108 mouse wheel cycle audio/sub tracks forward/backwards110 mouse wheel cycle audio/sub tracks forward/backwards
109 ============= ================================================111 ============= ================================================
110 112
111vol113vol
112 ============= ================================================114 ============= ================================================
113 left-click toggle mute115 left-click toggle mute
116 right-click open the audio device selector
114 mouse wheel volume up/down117 mouse wheel volume up/down
115 ============= ================================================118 ============= ================================================
116 119
player/lua/osc.lua+26−17
@@ -1703,7 +1703,7 @@ local function osc_init() · 1702 unmodified lines
1703 end1703 end
1704 1704
1705 ne.eventresponder["mbtn_left_up"] = function ()1705 ne.eventresponder["mbtn_left_up"] = function ()
1706 mp.command("script-binding stats/display-page-5")1706 mp.command("script-binding select/select-playlist; script-message-to osc osc-hide")
1707 end1707 end
1708 ne.eventresponder["shift+mbtn_left_up"] = function ()1708 ne.eventresponder["shift+mbtn_left_up"] = function ()
1709 mp.command("show-text ${filename}")1709 mp.command("show-text ${filename}")
@@ -1728,8 +1728,9 @@ local function osc_init() · 18 unmodified lines
1728 end1728 end
1729 ne.eventresponder["shift+mbtn_left_up"] =1729 ne.eventresponder["shift+mbtn_left_up"] =
1730 function () mp.command("show-text ${playlist} 3000") end1730 function () mp.command("show-text ${playlist} 3000") end
1731 ne.eventresponder["mbtn_right_up"] =1731 ne.eventresponder["mbtn_right_up"] = function ()
1732 function () mp.command("show-text ${playlist} 3000") end1732 mp.command("show-text ${playlist} 3000")
1733 end
1733 1734
1734 --next1735 --next
1735 ne = new_element("pl_next", "button")1736 ne = new_element("pl_next", "button")
@@ -1745,8 +1746,9 @@ local function osc_init() · 9 unmodified lines
1745 end1746 end
1746 ne.eventresponder["shift+mbtn_left_up"] =1747 ne.eventresponder["shift+mbtn_left_up"] =
1747 function () mp.command("show-text ${playlist} 3000") end1748 function () mp.command("show-text ${playlist} 3000") end
1748 ne.eventresponder["mbtn_right_up"] =1749 ne.eventresponder["mbtn_right_up"] = function ()
1749 function () mp.command("show-text ${playlist} 3000") end1750 mp.command("show-text ${playlist} 3000")
1751 end
1750 1752
1751 1753
1752 -- big buttons1754 -- big buttons
@@ -1806,8 +1808,9 @@ local function osc_init() · 53 unmodified lines
1806 end1808 end
1807 ne.eventresponder["shift+mbtn_left_up"] =1809 ne.eventresponder["shift+mbtn_left_up"] =
1808 function () mp.command("show-text ${chapter-list} 3000") end1810 function () mp.command("show-text ${chapter-list} 3000") end
1809 ne.eventresponder["mbtn_right_up"] =1811 ne.eventresponder["mbtn_right_up"] = function ()
1810 function () mp.command("show-text ${chapter-list} 3000") end1812 mp.command("script-binding select/select-chapter; script-message-to osc osc-hide")
1813 end
1811 1814
1812 --ch_next1815 --ch_next
1813 ne = new_element("ch_next", "button")1816 ne = new_element("ch_next", "button")
@@ -1823,8 +1826,9 @@ local function osc_init() · 9 unmodified lines
1823 end1826 end
1824 ne.eventresponder["shift+mbtn_left_up"] =1827 ne.eventresponder["shift+mbtn_left_up"] =
1825 function () mp.command("show-text ${chapter-list} 3000") end1828 function () mp.command("show-text ${chapter-list} 3000") end
1826 ne.eventresponder["mbtn_right_up"] =1829 ne.eventresponder["mbtn_right_up"] = function ()
1827 function () mp.command("show-text ${chapter-list} 3000") end1830 mp.command("script-binding select/select-chapter; script-message-to osc osc-hide")
1831 end
1828 1832
1829 --1833 --
1830 update_tracklist()1834 update_tracklist()
@@ -1837,12 +1841,13 @@ local function osc_init() · 6 unmodified lines
1837 return ("\238\132\134" .. osc_styles.smallButtonsLlabel .. " " ..1841 return ("\238\132\134" .. osc_styles.smallButtonsLlabel .. " " ..
1838 (mp.get_property_native("aid") or "-") .. "/" .. audio_track_count)1842 (mp.get_property_native("aid") or "-") .. "/" .. audio_track_count)
1839 end1843 end
1840 ne.eventresponder["mbtn_left_up"] =1844 ne.eventresponder["mbtn_left_up"] = function ()
1841 function () mp.command("cycle audio") end1845 mp.command("script-binding select/select-aid; script-message-to osc osc-hide")
1842 ne.eventresponder["mbtn_right_up"] =1846 end
1843 function () mp.command("cycle audio down") end
1844 ne.eventresponder["shift+mbtn_left_down"] =1847 ne.eventresponder["shift+mbtn_left_down"] =
1845 function () mp.command("show-text ${track-list/audio} 2000") end1848 function () mp.command("show-text ${track-list/audio} 2000") end
1849 ne.eventresponder["shift+mbtn_right_up"] =
1850 function () mp.command("show-text ${track-list/sub} 2000") end
1846 1851
1847 if user_opts.scrollcontrols then1852 if user_opts.scrollcontrols then
1848 ne.eventresponder["wheel_down_press"] =1853 ne.eventresponder["wheel_down_press"] =
@@ -1859,12 +1864,13 @@ local function osc_init() · 10 unmodified lines
1859 return ("\238\132\135" .. osc_styles.smallButtonsLlabel .. " " ..1864 return ("\238\132\135" .. osc_styles.smallButtonsLlabel .. " " ..
1860 (mp.get_property_native("sid") or "-") .. "/" .. sub_track_count)1865 (mp.get_property_native("sid") or "-") .. "/" .. sub_track_count)
1861 end1866 end
1862 ne.eventresponder["mbtn_left_up"] =1867 ne.eventresponder["mbtn_left_up"] = function ()
1863 function () mp.command("cycle sub") end1868 mp.command("script-binding select/select-sid; script-message-to osc osc-hide")
1864 ne.eventresponder["mbtn_right_up"] =1869 end
1865 function () mp.command("cycle sub down") end
1866 ne.eventresponder["shift+mbtn_left_down"] =1870 ne.eventresponder["shift+mbtn_left_down"] =
1867 function () mp.command("show-text ${track-list/sub} 2000") end1871 function () mp.command("show-text ${track-list/sub} 2000") end
1872 ne.eventresponder["shift+mbtn_right_up"] =
1873 function () mp.command("show-text ${track-list/sub} 2000") end
1868 1874
1869 if user_opts.scrollcontrols then1875 if user_opts.scrollcontrols then
1870 ne.eventresponder["wheel_down_press"] =1876 ne.eventresponder["wheel_down_press"] =
@@ -2074,6 +2080,9 @@ local function osc_init() · 203 unmodified lines
2074 end2080 end
2075 ne.eventresponder["mbtn_left_up"] =2081 ne.eventresponder["mbtn_left_up"] =
2076 function () mp.commandv("cycle", "mute") end2082 function () mp.commandv("cycle", "mute") end
2083 ne.eventresponder["mbtn_right_up"] = function ()
2084 mp.command("script-binding select/select-audio-device; script-message-to osc osc-hide")
2085 end
2077 2086
2078 if user_opts.scrollcontrols then2087 if user_opts.scrollcontrols then
2079 ne.eventresponder["wheel_up_press"] =2088 ne.eventresponder["wheel_up_press"] =

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t