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

Showing the changes to player/lua/osc.lua (1 of 2 files). Show all

Unified · Split

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