support input-default-bindings
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user