From: Kevin Lamonte Date: Sat, 21 Mar 2015 15:40:04 +0000 (-0400) Subject: support for kbTab in AWT X-Git-Tag: fanfix-swing-0.0.1~12^2~13^2~314 X-Git-Url: http://git.nikiroo.be/?a=commitdiff_plain;h=091d8a06c7f9f91c2a15c9350b6502cf4c10f5a3;p=fanfix-swing.git support for kbTab in AWT --- diff --git a/README.md b/README.md index 583957cf..af877888 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 20bd440c..208bea35 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 da521ddb..8b542402 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;