support input-default-bindings

This commit is contained in:
stax76
2021-10-24 17:08:07 +02:00
parent b115cf82d9
commit 9722d46d00
2 changed files with 8 additions and 27 deletions

View File

@@ -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)

View File

@@ -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)