History

select.lua: don't use add_forced_key_binding

There's no advantage in using the forced version here. It is a leftover from when this was an external script and forced was necessary to bind key sequences reliably until 3f83671f20.

Guido Cella committed 2 years ago

Commit e3eeaec1 parent 140196f1 file · +11 −11Browse files

Showing the changes to player/lua/select.lua (1 of 1 file). Show all

Unified · Split

player/lua/select.lua+11−11
@@ -25,7 +25,7 @@ local function show_error(message) · 24 unmodified lines
25 end25 end
26end26end
27 27
28mp.add_forced_key_binding(nil, "select-playlist", function ()28mp.add_key_binding(nil, "select-playlist", function ()
29 local playlist = {}29 local playlist = {}
30 local default_item30 local default_item
31 local show = mp.get_property_native("osd-playlist-entry")31 local show = mp.get_property_native("osd-playlist-entry")
@@ -108,7 +108,7 @@ local function format_track(track) · 76 unmodified lines
108 ):sub(1, -2) .. ")" .. format_flags(track)108 ):sub(1, -2) .. ")" .. format_flags(track)
109end109end
110 110
111mp.add_forced_key_binding(nil, "select-track", function ()111mp.add_key_binding(nil, "select-track", function ()
112 local tracks = {}112 local tracks = {}
113 113
114 for i, track in ipairs(mp.get_property_native("track-list")) do114 for i, track in ipairs(mp.get_property_native("track-list")) do
@@ -166,21 +166,21 @@ local function select_track(property, type, prompt, error) · 51 unmodified lines
166 })166 })
167end167end
168 168
169mp.add_forced_key_binding(nil, "select-sid", function ()169mp.add_key_binding(nil, "select-sid", function ()
170 select_track("sid", "sub", "Select a subtitle:", "No available subtitles.")170 select_track("sid", "sub", "Select a subtitle:", "No available subtitles.")
171end)171end)
172 172
173mp.add_forced_key_binding(nil, "select-secondary-sid", function ()173mp.add_key_binding(nil, "select-secondary-sid", function ()
174 select_track("secondary-sid", "sub", "Select a secondary subtitle:",174 select_track("secondary-sid", "sub", "Select a secondary subtitle:",
175 "No available subtitles.")175 "No available subtitles.")
176end)176end)
177 177
178mp.add_forced_key_binding(nil, "select-aid", function ()178mp.add_key_binding(nil, "select-aid", function ()
179 select_track("aid", "audio", "Select an audio track:",179 select_track("aid", "audio", "Select an audio track:",
180 "No available audio tracks.")180 "No available audio tracks.")
181end)181end)
182 182
183mp.add_forced_key_binding(nil, "select-vid", function ()183mp.add_key_binding(nil, "select-vid", function ()
184 select_track("vid", "video", "Select a video track:",184 select_track("vid", "video", "Select a video track:",
185 "No available video tracks.")185 "No available video tracks.")
186end)186end)
@@ -198,7 +198,7 @@ local function format_time(t, duration) · 11 unmodified lines
198 return string.format("%.2d:%.2d", m, s)198 return string.format("%.2d:%.2d", m, s)
199end199end
200 200
201mp.add_forced_key_binding(nil, "select-chapter", function ()201mp.add_key_binding(nil, "select-chapter", function ()
202 local chapters = {}202 local chapters = {}
203 local default_item = mp.get_property_native("chapter")203 local default_item = mp.get_property_native("chapter")
204 204
@@ -223,7 +223,7 @@ mp.add_forced_key_binding(nil, "select-chapter", function () · 18 unmodified lines
223 })223 })
224end)224end)
225 225
226mp.add_forced_key_binding(nil, "select-subtitle-line", function ()226mp.add_key_binding(nil, "select-subtitle-line", function ()
227 local sub = mp.get_property_native("current-tracks/sub")227 local sub = mp.get_property_native("current-tracks/sub")
228 228
229 if sub == nil then229 if sub == nil then
@@ -290,7 +290,7 @@ mp.add_forced_key_binding(nil, "select-subtitle-line", function () · 60 unmodified lines
290 })290 })
291end)291end)
292 292
293mp.add_forced_key_binding(nil, "select-audio-device", function ()293mp.add_key_binding(nil, "select-audio-device", function ()
294 local devices = mp.get_property_native("audio-device-list")294 local devices = mp.get_property_native("audio-device-list")
295 local items = {}295 local items = {}
296 -- This is only useful if an --audio-device has been explicitly set,296 -- This is only useful if an --audio-device has been explicitly set,
@@ -322,7 +322,7 @@ mp.add_forced_key_binding(nil, "select-audio-device", function () · 25 unmodified lines
322 })322 })
323end)323end)
324 324
325mp.add_forced_key_binding(nil, "select-binding", function ()325mp.add_key_binding(nil, "select-binding", function ()
326 local bindings = {}326 local bindings = {}
327 327
328 for _, binding in pairs(mp.get_property_native("input-bindings")) do328 for _, binding in pairs(mp.get_property_native("input-bindings")) do
@@ -368,7 +368,7 @@ local function add_property(property, value) · 39 unmodified lines
368 end368 end
369end369end
370 370
371mp.add_forced_key_binding(nil, "show-properties", function ()371mp.add_key_binding(nil, "show-properties", function ()
372 properties = {}372 properties = {}
373 373
374 -- Don't log errors for renamed and removed properties.374 -- Don't log errors for renamed and removed properties.

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