support for kbTab in AWT
authorKevin Lamonte <kevin.lamonte@gmail.com>
Sat, 21 Mar 2015 15:40:04 +0000 (11:40 -0400)
committerKevin Lamonte <kevin.lamonte@gmail.com>
Sat, 21 Mar 2015 15:40:04 +0000 (11:40 -0400)
README.md
src/jexer/io/AWTScreen.java
src/jexer/io/AWTTerminal.java

index 583957cf11414fe93e2df0a7a3ae7e3edbed1a80..af877888f665d3cd8af02457bc73cc7b64bd3457 100644 (file)
--- 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
index 20bd440cd7dbf2ea34e6b43234ac7d0d082e0c53..208bea356496334386bf2ee0cd02b2172cdcdbe7 100644 (file)
@@ -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();
         }
 
index da521ddb0fc3c7fa435bef3ae8aee22d9b3217c3..8b542402daf5b7321de855fbeffd8d31f09559c7 100644 (file)
@@ -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;