Skip to content

Commit

Permalink
try fixing #662
Browse files Browse the repository at this point in the history
  • Loading branch information
stax76 committed Sep 5, 2024
1 parent 9355e2f commit 94ecf4a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -1093,11 +1093,11 @@ Cycles the deinterlace property using the following command:

Cycles the aspect ratio using the following command:

`cycle-values video-aspect 16:9 4:3 2.35:1 -1`
`cycle-values video-aspect-override 16:9 4:3 2.35:1 0 -1`

[cycle-values command](https://mpv.io/manual/master/#command-interface-cycle-values)

[video-aspect property](https://mpv.io/manual/master/#command-interface-video-aspect)
[video-aspect property](https://mpv.io/manual/master/#options-video-aspect-override)


### Audio > Next
Expand Down
7 changes: 4 additions & 3 deletions src/MpvNet.Windows/WinForms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1046,11 +1046,12 @@ protected override void WndProc(ref Message m)
break;
case 0x319: // WM_APPCOMMAND
{
string? value = MpvHelp.WM_APPCOMMAND_to_mpv_key((int)(m.LParam.ToInt64() >> 16 & ~0xf000));
string? key = MpvHelp.WM_APPCOMMAND_to_mpv_key((int)(m.LParam.ToInt64() >> 16 & ~0xf000));
bool inputMediaKeys = Player.GetPropertyBool("input-media-keys");

if (value != null)
if (key != null && inputMediaKeys)
{
Player.Command("keypress " + value);
Player.Command("keypress " + key);
m.Result = new IntPtr(1);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/MpvNet/InputHelp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public static List<Binding> GetDefaults()
new (_("Video"), _("Take Screenshot"), "async screenshot", "s"),
new (_("Video"), _("Take Screenshot without subtitles"), "async screenshot video", "S"),
new (_("Video"), _("Toggle Deinterlace"), "cycle deinterlace", "d"),
new (_("Video"), _("Change Aspect Ratio"), "cycle-values video-aspect-override 16:9 4:3 2.35:1 -1", "a"),
new (_("Video"), _("Change Aspect Ratio"), "cycle-values video-aspect-override 16:9 4:3 2.35:1 0 -1", "a"),
new (_("Video"), _("Rotate Video"), "cycle-values video-rotate 90 180 270 0", "Ctrl+r"),

new (_("Audio"), _("Audio Device")),
Expand Down
1 change: 1 addition & 0 deletions src/MpvNet/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public void Init(IntPtr formHandle, bool processCommandLine)

SetPropertyBool("input-default-bindings", true);
SetPropertyBool("input-builtin-bindings", false);
SetPropertyBool("input-media-keys", true);

SetPropertyString("media-controls", "yes");
SetPropertyString("idle", "yes");
Expand Down

0 comments on commit 94ecf4a

Please sign in to comment.