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
2525 end
2626 end
2727
28−mp.add_forced_key_binding(nil, "select-playlist", function ()
28+mp.add_key_binding(nil, "select-playlist", function ()
2929 local playlist = {}
3030 local default_item
3131 local show = mp.get_property_native("osd-playlist-entry")
@@ -108,7 +108,7 @@ local function format_track(track) · 76 unmodified lines
108108 ):sub(1, -2) .. ")" .. format_flags(track)
109109 end
110110
111−mp.add_forced_key_binding(nil, "select-track", function ()
111+mp.add_key_binding(nil, "select-track", function ()
112112 local tracks = {}
113113
114114 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
166166 })
167167 end
168168
169−mp.add_forced_key_binding(nil, "select-sid", function ()
169+mp.add_key_binding(nil, "select-sid", function ()
170170 select_track("sid", "sub", "Select a subtitle:", "No available subtitles.")
171171 end)
172172
173−mp.add_forced_key_binding(nil, "select-secondary-sid", function ()
173+mp.add_key_binding(nil, "select-secondary-sid", function ()
174174 select_track("secondary-sid", "sub", "Select a secondary subtitle:",
175175 "No available subtitles.")
176176 end)
177177
178−mp.add_forced_key_binding(nil, "select-aid", function ()
178+mp.add_key_binding(nil, "select-aid", function ()
179179 select_track("aid", "audio", "Select an audio track:",
180180 "No available audio tracks.")
181181 end)
182182
183−mp.add_forced_key_binding(nil, "select-vid", function ()
183+mp.add_key_binding(nil, "select-vid", function ()
184184 select_track("vid", "video", "Select a video track:",
185185 "No available video tracks.")
186186 end)
@@ -198,7 +198,7 @@ local function format_time(t, duration) · 11 unmodified lines
198198 return string.format("%.2d:%.2d", m, s)
199199 end
200200
201−mp.add_forced_key_binding(nil, "select-chapter", function ()
201+mp.add_key_binding(nil, "select-chapter", function ()
202202 local chapters = {}
203203 local default_item = mp.get_property_native("chapter")
204204
@@ -223,7 +223,7 @@ mp.add_forced_key_binding(nil, "select-chapter", function () · 18 unmodified lines
223223 })
224224 end)
225225
226−mp.add_forced_key_binding(nil, "select-subtitle-line", function ()
226+mp.add_key_binding(nil, "select-subtitle-line", function ()
227227 local sub = mp.get_property_native("current-tracks/sub")
228228
229229 if sub == nil then
@@ -290,7 +290,7 @@ mp.add_forced_key_binding(nil, "select-subtitle-line", function () · 60 unmodified lines
290290 })
291291 end)
292292
293−mp.add_forced_key_binding(nil, "select-audio-device", function ()
293+mp.add_key_binding(nil, "select-audio-device", function ()
294294 local devices = mp.get_property_native("audio-device-list")
295295 local items = {}
296296 -- 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
322322 })
323323 end)
324324
325−mp.add_forced_key_binding(nil, "select-binding", function ()
325+mp.add_key_binding(nil, "select-binding", function ()
326326 local bindings = {}
327327
328328 for _, binding in pairs(mp.get_property_native("input-bindings")) do
@@ -368,7 +368,7 @@ local function add_property(property, value) · 39 unmodified lines
368368 end
369369 end
370370
371−mp.add_forced_key_binding(nil, "show-properties", function ()
371+mp.add_key_binding(nil, "show-properties", function ()
372372 properties = {}
373373
374374 -- 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