changeset 145:4dfa4dd791c1

testing setfield functions
author Carl Byington <carl@five-ten-sg.com>
date Sat, 21 Jun 2014 17:18:06 -0700
parents 03af90a2f0a9
children 8754f293f2fd
files src/com/five_ten_sg/connectbot/service/TerminalMonitor.java src/com/five_ten_sg/connectbot/transport/TN5250.java
diffstat 2 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/com/five_ten_sg/connectbot/service/TerminalMonitor.java	Sat Jun 21 16:27:49 2014 -0700
+++ b/src/com/five_ten_sg/connectbot/service/TerminalMonitor.java	Sat Jun 21 17:18:06 2014 -0700
@@ -371,7 +371,7 @@
         for (i = 0; i < da.length; i++) {
             da[i] = data[i + offset];
         }
-        if (da.length == 0) da = new char[] {' '};
+
         buffer.setField(l, c, da);
     }
 
--- a/src/com/five_ten_sg/connectbot/transport/TN5250.java	Sat Jun 21 16:27:49 2014 -0700
+++ b/src/com/five_ten_sg/connectbot/transport/TN5250.java	Sat Jun 21 17:18:06 2014 -0700
@@ -62,7 +62,6 @@
     private tnvt       handler = null;
     private Socket     socket;
     private boolean    connected = false;
-    private TerminalKeyListener keyListener = null;
 
     static final Pattern hostmask;
     static {
@@ -154,8 +153,12 @@
         public void write(int b) {
             if (b == 120) {
                 // special case x for testing
-                KeyEvent event = new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_F3);
-                keyListener.onKey(bridge.parent, event.getKeyCode(), event);
+                setField(17, 44, new char[] { '1', '2' });
+                keyPressed(KEY_TAB, ' ', 0);
+                keyPressed(KEY_TAB, ' ', 0);
+                setField(-1, -1, new char[] { '2', '3' });
+                setField(18, 44, new char[0]);
+                setField(-1, -1, new char[] { '4', '5' });
                 return;
             }
             if (controls.containsKey(b)) {
@@ -451,8 +454,7 @@
     }
 
     public TerminalKeyListener getTerminalKeyListener() {
-        keyListener = new TerminalKeyListener(manager, bridge, buffer, host.getEncoding());
-        return keyListener;
+        return new TerminalKeyListener(manager, bridge, buffer, host.getEncoding());
     }
 
 }