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.
Unified · Split
| @@ -25,7 +25,7 @@ local function show_error(message) · 24 unmodified lines | |||
| 25 | end | 25 | end |
| 26 | end | 26 | end |
| 27 | 27 | ||
| 28 | mp.add_forced_key_binding(nil, "select-playlist", function () | 28 | mp.add_key_binding(nil, "select-playlist", function () |
| 29 | local playlist = {} | 29 | local playlist = {} |
| 30 | local default_item | 30 | 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) |
| 109 | end | 109 | end |
| 110 | 110 | ||
| 111 | mp.add_forced_key_binding(nil, "select-track", function () | 111 | mp.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")) do | 114 | 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 | }) |
| 167 | end | 167 | end |
| 168 | 168 | ||
| 169 | mp.add_forced_key_binding(nil, "select-sid", function () | 169 | mp.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.") |
| 171 | end) | 171 | end) |
| 172 | 172 | ||
| 173 | mp.add_forced_key_binding(nil, "select-secondary-sid", function () | 173 | mp.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.") |
| 176 | end) | 176 | end) |
| 177 | 177 | ||
| 178 | mp.add_forced_key_binding(nil, "select-aid", function () | 178 | mp.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.") |
| 181 | end) | 181 | end) |
| 182 | 182 | ||
| 183 | mp.add_forced_key_binding(nil, "select-vid", function () | 183 | mp.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.") |
| 186 | end) | 186 | end) |
| @@ -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) |
| 199 | end | 199 | end |
| 200 | 200 | ||
| 201 | mp.add_forced_key_binding(nil, "select-chapter", function () | 201 | mp.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 | }) |
| 224 | end) | 224 | end) |
| 225 | 225 | ||
| 226 | mp.add_forced_key_binding(nil, "select-subtitle-line", function () | 226 | mp.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 then | 229 | if sub == nil then |
| @@ -290,7 +290,7 @@ mp.add_forced_key_binding(nil, "select-subtitle-line", function () · 60 unmodified lines | |||
| 290 | }) | 290 | }) |
| 291 | end) | 291 | end) |
| 292 | 292 | ||
| 293 | mp.add_forced_key_binding(nil, "select-audio-device", function () | 293 | mp.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 | }) |
| 323 | end) | 323 | end) |
| 324 | 324 | ||
| 325 | mp.add_forced_key_binding(nil, "select-binding", function () | 325 | mp.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")) do | 328 | 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 | end | 368 | end |
| 369 | end | 369 | end |
| 370 | 370 | ||
| 371 | mp.add_forced_key_binding(nil, "show-properties", function () | 371 | mp.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. |