From 9722d46d001659758ba26fab3a2baee5a4f98ad0 Mon Sep 17 00:00:00 2001 From: stax76 Date: Sun, 24 Oct 2021 17:08:07 +0200 Subject: [PATCH] support input-default-bindings --- docs/Changelog.md | 2 +- src/Misc/CorePlayer.cs | 33 +++++++-------------------------- 2 files changed, 8 insertions(+), 27 deletions(-) diff --git a/docs/Changelog.md b/docs/Changelog.md index 2ee4d93..436363e 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -3,7 +3,7 @@ - Window size flicker issue fix when changing files. - Support input-builtin-bindings to make mp.add_key_binding behave same as in mpv. -- libmpv shinchiro 2021-10-10 +- libmpv shinchiro 2021-10-17 5.5.0.3 Beta (2021-09-23) diff --git a/src/Misc/CorePlayer.cs b/src/Misc/CorePlayer.cs index 9b7eeaf..d74b60d 100644 --- a/src/Misc/CorePlayer.cs +++ b/src/Misc/CorePlayer.cs @@ -1,7 +1,6 @@  using System; using System.Collections.Generic; -using System.Diagnostics; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; @@ -153,7 +152,13 @@ namespace mpvnet SetPropertyBool("keep-open", true); SetPropertyBool("keep-open-pause", false); - SetInputBindingProperties(); + SetPropertyBool("input-default-bindings", true); + + try { + SetPropertyBool("input-builtin-bindings", false, true); + } catch { + SetPropertyBool("input-default-bindings", false); + } ProcessCommandLine(true); mpv_error err = mpv_initialize(Handle); @@ -170,30 +175,6 @@ namespace mpvnet InvokeAsync(InitializedAsync); } - void SetInputBindingProperties() - { - if (Debugger.IsAttached) - { - if (GetPropertyString("property-list").Contains("input-builtin-bindings")) - throw new Exception(); - else - SetPropertyBool("input-default-bindings", false); - } - else - { - SetPropertyBool("input-default-bindings", true); - - try - { - SetPropertyBool("input-builtin-bindings", false, true); - } - catch - { - SetPropertyBool("input-default-bindings", false); - } - } - } - void ApplyCompatibilityFixes() { if (!App.Settings.InputDefaultBindingsFixApplied)