Support Shift-Tab
authorKevin Lamonte <kevin.lamonte@gmail.com>
Mon, 6 Mar 2017 17:26:43 +0000 (12:26 -0500)
committerKevin Lamonte <kevin.lamonte@gmail.com>
Mon, 6 Mar 2017 17:26:43 +0000 (12:26 -0500)
src/jexer/demos/Demo3.java
src/jexer/tterminal/ECMA48.java

index b8181bd1b103de36337efef595abc4dc108f530a..57122969114d915265d42ed703e1d2cb1e254613 100644 (file)
@@ -44,10 +44,6 @@ public class Demo3 {
      */
     public static void main(final String [] args) {
         try {
-            if (args.length == 0) {
-                System.err.printf("USAGE: java -cp jexer.jar jexer.demos.Demo3\n");
-                return;
-            }
             DemoApplication app = new DemoApplication(System.in,
                 new InputStreamReader(System.in, "UTF-8"),
                 new PrintWriter(new OutputStreamWriter(System.out, "UTF-8")),
index 97c9b41711624adef14e228d01b2049598b6b050..7869829753df190c64306b51583731f3d812faec 100644 (file)
@@ -698,7 +698,7 @@ public class ECMA48 implements Runnable {
                 return columns132;
         }
 
-        /**
+    /**
      * true = reverse video.  Set by DECSCNM.
      */
     private boolean reverseVideo = false;
@@ -1916,6 +1916,17 @@ public class ECMA48 implements Runnable {
             return "\011";
         }
 
+        if ((keypress.equalsWithoutModifiers(kbBackTab)) ||
+            (keypress.equals(kbShiftTab))
+        ) {
+            switch (type) {
+            case XTERM:
+                return "\033[Z";
+            default:
+                return "\011";
+            }
+        }
+
         // Non-alt, non-ctrl characters
         if (!keypress.isFnKey()) {
             StringBuilder sb = new StringBuilder();