Browse Source

Disabled unix key bindings for TextView

Tig 10 months ago
parent
commit
7109a8129a
2 changed files with 7 additions and 8 deletions
  1. 0 4
      Terminal.Gui/Views/TextField.cs
  2. 7 4
      Terminal.Gui/Views/TextView.cs

+ 0 - 4
Terminal.Gui/Views/TextField.cs

@@ -324,10 +324,6 @@ public class TextField : View
                     }
                    );
 
-        // By Default pressing ENTER should be ignored (OnAccept will return false or null). Only cancel if the
-        //// event was fired and set Cancel = true.
-        //AddCommand (Command.Accept, RaiseAcceptEvent);
-
         // Default keybindings for this view
         // We follow this as closely as possible: https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts
         KeyBindings.Add (Key.Delete, Command.DeleteCharRight);

+ 7 - 4
Terminal.Gui/Views/TextView.cs

@@ -2411,7 +2411,6 @@ public class TextView : View
         KeyBindings.Add (Key.PageDown.WithShift, Command.PageDownExtend);
 
         KeyBindings.Add (Key.PageUp, Command.PageUp);
-        KeyBindings.Add (Key.V.WithAlt, Command.PageUp);
 
         KeyBindings.Add (Key.PageUp.WithShift, Command.PageUpExtend);
 
@@ -2461,15 +2460,12 @@ public class TextView : View
         KeyBindings.Add (Key.Y.WithCtrl, Command.Paste); // Control-y, yank
         KeyBindings.Add (Key.Space.WithCtrl, Command.ToggleExtend);
 
-        KeyBindings.Add (Key.C.WithAlt, Command.Copy);
         KeyBindings.Add (Key.C.WithCtrl, Command.Copy);
 
-        KeyBindings.Add (Key.W.WithAlt, Command.Cut);
         KeyBindings.Add (Key.W.WithCtrl, Command.Cut);
         KeyBindings.Add (Key.X.WithCtrl, Command.Cut);
 
         KeyBindings.Add (Key.CursorLeft.WithCtrl, Command.WordLeft);
-        KeyBindings.Add (Key.B.WithAlt, Command.WordLeft);
 
         KeyBindings.Add (Key.CursorLeft.WithCtrl.WithShift, Command.WordLeftExtend);
 
@@ -2495,6 +2491,13 @@ public class TextView : View
         KeyBindings.Add (Key.G.WithCtrl, Command.DeleteAll);
         KeyBindings.Add (Key.D.WithCtrl.WithShift, Command.DeleteAll);
 
+#if UNIX_KEY_BINDINGS
+        KeyBindings.Add (Key.C.WithAlt, Command.Copy);
+        KeyBindings.Add (Key.B.WithAlt, Command.WordLeft);
+        KeyBindings.Add (Key.W.WithAlt, Command.Cut);
+        KeyBindings.Add (Key.V.WithAlt, Command.PageUp);
+#endif
+
         _currentCulture = Thread.CurrentThread.CurrentUICulture;
 
         ContextMenu = new ();