diff src/de/mud/terminal/vt320.java @ 79:01d939969b10

merge tn5250 branch into default
author Carl Byington <carl@five-ten-sg.com>
date Mon, 16 Jun 2014 08:24:00 -0700
parents 8181cb01c64d
children 171e0a977544
line wrap: on
line diff
--- a/src/de/mud/terminal/vt320.java	Tue Jun 03 08:48:14 2014 -0700
+++ b/src/de/mud/terminal/vt320.java	Mon Jun 16 08:24:00 2014 -0700
@@ -39,12 +39,6 @@
  */
 public abstract class vt320 extends VDUBuffer implements VDUInput {
 
-    /** The current version id tag.<P>
-     * $Id: vt320.java 507 2005-10-25 10:14:52Z marcus $
-     *
-     */
-    public final static String ID = "$Id: vt320.java 507 2005-10-25 10:14:52Z marcus $";
-
     /** the debug level */
     private final static int debug = 0;
     private StringBuilder debugStr;
@@ -72,12 +66,27 @@
     }
 
     /**
+     * inject field contents as if typed
+     */
+    public void setField(int l, int c, char [] d) {
+        // ignore line and column, just send the bytes to the host.
+        int n = d.length;
+        byte [] b = new byte [n];
+        for (int i=0; i<n; i++) b[i] = (byte)(d[i] & 0x00ff);
+        write(b);
+    }
+
+    /**
      * Play the beep sound ...
      */
     public void beep() {
         /* do nothing by default */
     }
 
+    public void redrawPassthru() {
+        redraw();   // VDUBuffer.redraw is protected
+    }
+
     /**
      * Convenience function for putString(char[], int, int)
      */
@@ -741,8 +750,9 @@
     public final static int KEY_NUMPAD8 = 39;
     public final static int KEY_NUMPAD9 = 40;
     public final static int KEY_DECIMAL = 41;
-    public final static int KEY_ADD = 42;
-    public final static int KEY_ESCAPE = 43;
+    public final static int KEY_ADD     = 42;
+    public final static int KEY_ESCAPE  = 43;
+    public final static int KEY_TAB     = 44;
 
     public final static int DELETE_IS_DEL = 0;
     public final static int DELETE_IS_BACKSPACE = 1;
@@ -1094,12 +1104,24 @@
 
             case KEY_CAPS_LOCK:
                 capslock = !capslock;
-                return;
+                break;
 
             case KEY_SHIFT:
             case KEY_CONTROL:
             case KEY_ALT:
-                return;
+                break;
+
+            case KEY_ESCAPE:
+                write(0x1b);
+                break;
+
+            case KEY_ENTER:
+                write(0x0d);
+                break;
+
+            case KEY_TAB:
+                write(0x09);
+                break;
 
             default:
                 break;