From 219458658fb8479f61a0474b86bcb3fcc8baffc3 Mon Sep 17 00:00:00 2001 From: BDisp Date: Thu, 30 May 2024 13:44:37 +0100 Subject: [PATCH] Replace #define UNIX_KEY_BINDINGS with conditional PlatformID.Unix. --- Terminal.Gui/Views/Toplevel.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Terminal.Gui/Views/Toplevel.cs b/Terminal.Gui/Views/Toplevel.cs index 4a8c68328..7ada6bc29 100644 --- a/Terminal.Gui/Views/Toplevel.cs +++ b/Terminal.Gui/Views/Toplevel.cs @@ -1,7 +1,3 @@ -#define UNIX_KEY_BINDINGS - -using System.Net.Mime; - namespace Terminal.Gui; /// @@ -126,8 +122,12 @@ public partial class Toplevel : View KeyBindings.Add (Application.AlternateForwardKey, Command.NextViewOrTop); // Needed on Unix KeyBindings.Add (Application.AlternateBackwardKey, Command.PreviousViewOrTop); // Needed on Unix + if (Environment.OSVersion.Platform == PlatformID.Unix) + { + KeyBindings.Add (Key.Z.WithCtrl, Command.Suspend); + } + #if UNIX_KEY_BINDINGS - KeyBindings.Add (Key.Z.WithCtrl, Command.Suspend); KeyBindings.Add (Key.L.WithCtrl, Command.Refresh); // Unix KeyBindings.Add (Key.F.WithCtrl, Command.NextView); // Unix KeyBindings.Add (Key.I.WithCtrl, Command.NextView); // Unix