From f1c4c25e3e5c89aff7da36caaba1a94ecc379e4d Mon Sep 17 00:00:00 2001 From: Kevin Lamonte Date: Mon, 6 Mar 2017 12:26:43 -0500 Subject: [PATCH] Support Shift-Tab --- src/jexer/demos/Demo3.java | 4 ---- src/jexer/tterminal/ECMA48.java | 13 ++++++++++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/jexer/demos/Demo3.java b/src/jexer/demos/Demo3.java index b8181bd..5712296 100644 --- a/src/jexer/demos/Demo3.java +++ b/src/jexer/demos/Demo3.java @@ -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")), diff --git a/src/jexer/tterminal/ECMA48.java b/src/jexer/tterminal/ECMA48.java index 97c9b41..7869829 100644 --- a/src/jexer/tterminal/ECMA48.java +++ b/src/jexer/tterminal/ECMA48.java @@ -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(); -- 2.27.0