Bläddra i källkod

Revert "Fixes Option + Left/Right for Macs"

xuty 4 år sedan
förälder
incheckning
cce56db683

+ 6 - 7
lib/frontend/input_behavior_default.dart

@@ -1,5 +1,3 @@
-import 'dart:io';
-
 import 'package:flutter/services.dart';
 import 'package:flutter/widgets.dart';
 import 'package:xterm/frontend/input_behavior.dart';
@@ -24,11 +22,12 @@ class InputBehaviorDefault extends InputBehavior {
     final key = inputMap(event.logicalKey);
 
     if (key != null) {
-      terminal.keyInput(key,
-          ctrl: event.isControlPressed,
-          alt: event.isAltPressed,
-          shift: event.isShiftPressed,
-          mac: Platform.isMacOS);
+      terminal.keyInput(
+        key,
+        ctrl: event.isControlPressed,
+        alt: event.isAltPressed,
+        shift: event.isShiftPressed,
+      );
     }
   }
 

+ 2 - 5
lib/input/keytab/keytab_default.dart

@@ -74,11 +74,8 @@ key Left  -Shift-AnyMod+Ansi-AppCuKeys : "\E[D"
 
 key Up    -Shift+AnyMod+Ansi           : "\E[1;5A"
 key Down  -Shift+AnyMod+Ansi           : "\E[1;5B"
-key Right -Shift+AnyMod+Ansi-Mac       : "\E[1;5C"
-key Left  -Shift+AnyMod+Ansi-Mac       : "\E[1;5D"
-
-key Right -Shift+AnyMod+Ansi+Mac       : "\Ef"
-key Left  -Shift+AnyMod+Ansi+Mac       : "\Eb"
+key Right -Shift+AnyMod+Ansi           : "\E[1;5C"
+key Left  -Shift+AnyMod+Ansi           : "\E[1;5D"
 
 key Up    +Shift+AppScreen             : "\E[1;*A"
 key Down  +Shift+AppScreen             : "\E[1;*B"

+ 14 - 18
lib/input/keytab/keytab_parse.dart

@@ -91,7 +91,6 @@ class KeytabParser {
     bool? appCursorKeys;
     bool? appKeyPad;
     bool? newLine;
-    bool? mac;
 
     while (reader.peek()!.type == KeytabTokenType.modeStatus) {
       bool modeStatus;
@@ -142,9 +141,6 @@ class KeytabParser {
         case 'NewLine':
           newLine = modeStatus;
           break;
-        case 'Mac':
-          mac = modeStatus;
-          break;
         default:
           throw ParseError();
       }
@@ -165,20 +161,20 @@ class KeytabParser {
     }
 
     final record = KeytabRecord(
-        qtKeyName: keyName.value,
-        key: key,
-        action: action,
-        alt: alt,
-        ctrl: ctrl,
-        shift: shift,
-        anyModifier: anyModifier,
-        ansi: ansi,
-        appScreen: appScreen,
-        keyPad: keyPad,
-        appCursorKeys: appCursorKeys,
-        appKeyPad: appKeyPad,
-        newLine: newLine,
-        mac: mac);
+      qtKeyName: keyName.value,
+      key: key,
+      action: action,
+      alt: alt,
+      ctrl: ctrl,
+      shift: shift,
+      anyModifier: anyModifier,
+      ansi: ansi,
+      appScreen: appScreen,
+      keyPad: keyPad,
+      appCursorKeys: appCursorKeys,
+      appKeyPad: appKeyPad,
+      newLine: newLine,
+    );
 
     _records.add(record);
   }

+ 0 - 6
lib/input/keytab/keytab_record.dart

@@ -39,7 +39,6 @@ class KeytabRecord {
     required this.appCursorKeys,
     required this.appKeyPad,
     required this.newLine,
-    required this.mac,
   });
 
   String qtKeyName;
@@ -56,7 +55,6 @@ class KeytabRecord {
   bool? appCursorKeys;
   bool? appKeyPad;
   bool? newLine;
-  bool? mac;
 
   @override
   String toString() {
@@ -103,10 +101,6 @@ class KeytabRecord {
       buffer.write(modeStatus(newLine!, 'NewLine'));
     }
 
-    if (mac != null) {
-      buffer.write(modeStatus(mac!, 'Mac'));
-    }
-
     buffer.write(' : $action');
 
     return buffer.toString();

+ 0 - 5
lib/terminal/terminal.dart

@@ -364,7 +364,6 @@ class Terminal with Observable {
     bool ctrl = false,
     bool alt = false,
     bool shift = false,
-    bool mac = false,
     // bool meta,
   }) {
     debug.onMsg(key);
@@ -409,10 +408,6 @@ class Terminal with Observable {
         continue;
       }
 
-      if (record.mac != null && record.mac != mac) {
-        continue;
-      }
-
       // TODO: support VT52
       if (record.ansi == false) {
         continue;