From: Kevin Lamonte Date: Sat, 21 Mar 2015 15:40:04 +0000 (-0400) Subject: support for kbTab in AWT X-Git-Tag: fanfix-3.0.1^2~318 X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=091d8a06c7f9f91c2a15c9350b6502cf4c10f5a3;p=fanfix.git support for kbTab in AWT --- diff --git a/README.md b/README.md index 583957c..af87788 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,6 @@ Many tasks remain before calling this version 1.0: - Making TMenu keyboard accelerators active/inactive - AWT: - Blinking cursor - - Handle kbTab (disable focus traversal BS) - Block cursor - ECMA48Backend running on socket - TTreeView diff --git a/src/jexer/io/AWTScreen.java b/src/jexer/io/AWTScreen.java index 20bd440..208bea3 100644 --- a/src/jexer/io/AWTScreen.java +++ b/src/jexer/io/AWTScreen.java @@ -265,11 +265,15 @@ public final class AWTScreen extends Screen { // Transparent 16 x 16 pixel cursor image. BufferedImage cursorImg = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB); - // Create a new blank cursor. Cursor blankCursor = Toolkit.getDefaultToolkit().createCustomCursor( cursorImg, new Point(0, 0), "blank cursor"); setCursor(blankCursor); + + // Be capable of seeing Tab / Shift-Tab + setFocusTraversalKeysEnabled(false); + + // Save the text cell width/height getFontDimensions(); } diff --git a/src/jexer/io/AWTTerminal.java b/src/jexer/io/AWTTerminal.java index da521dd..8b54240 100644 --- a/src/jexer/io/AWTTerminal.java +++ b/src/jexer/io/AWTTerminal.java @@ -373,7 +373,11 @@ public final class AWTTerminal implements ComponentListener, KeyListener, keypress = kbEnter; break; case 0x09: - keypress = kbTab; + if (shift) { + keypress = kbShiftTab; + } else { + keypress = kbTab; + } break; case 0x7F: keypress = kbDel;