changeset 212:4ecd8a39afb3

cursor movement reporting changes
author Carl Byington <carl@five-ten-sg.com>
date Mon, 07 Jul 2014 12:32:22 -0700
parents 7e4352b53f24
children d198328918fe
files src/com/five_ten_sg/connectbot/service/TerminalMonitor.java src/com/five_ten_sg/connectbot/transport/TN5250.java
diffstat 2 files changed, 4 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/src/com/five_ten_sg/connectbot/service/TerminalMonitor.java	Mon Jul 07 10:19:04 2014 -0700
+++ b/src/com/five_ten_sg/connectbot/service/TerminalMonitor.java	Mon Jul 07 12:32:22 2014 -0700
@@ -54,7 +54,6 @@
     private int                 start_column = 0;       // ""
     private int                 end_column   = 500;     // ""
     private boolean             modified     = false;   // used to delay screen change notifications
-    private boolean             moved        = false;   // used to delay cursor moved notifications
     private int                 to_line      = 0;       // ""
     private int                 to_column    = 0;       // ""
     private HashMap<Integer, Integer>  keymap = null;   // map MS VK_ keys to vt320 virtual keys
@@ -363,7 +362,6 @@
     }
 
     public synchronized void cursorMove(int l, int c) {
-        moved = true;
         to_line = l;
         to_column = c;
     }
@@ -379,10 +377,6 @@
         if (modified) {
             modified = false;
             sendScreen(MONITOR_CMD_SCREENCHANGE);
-        }
-
-        if (moved) {
-            moved = false;
             cursorMoved();
         }
     }
@@ -450,7 +444,7 @@
 
     public synchronized void cursorRequest() {
         Log.i(TAG, "cursorRequest()");
-        testChanged();
+        cursorMoved();
     }
 
 }
--- a/src/com/five_ten_sg/connectbot/transport/TN5250.java	Mon Jul 07 10:19:04 2014 -0700
+++ b/src/com/five_ten_sg/connectbot/transport/TN5250.java	Mon Jul 07 12:32:22 2014 -0700
@@ -177,39 +177,18 @@
         @Override
         public void write(byte[] b) {
             screen52.sendKeys(new String(b));
-            testChanged();
+            cursorMoved();
         }
         @Override
         public void write(int b) {
-            /*
-            if (b == 120) {
-                // special case x for testing
-                setField(17, 40, new char[] { '1', '2' });
-                setField(17, 44, new char[0]);
-                setField(-1, -1, new char[] { '3', '4' });
-                setField(18, 40, new char[0]);
-                setField(-1, -1, new char[] { '5', '6' });
-                return;
-            }
-            if (b == 121) {
-                // special case y for testing
-                setField(17, 43, new char[0]);
-                return;
-            }
-            if (b == 122) {
-                // special case z for testing
-                setField(17, 41, new char[0]);
-                return;
-            }
-            */
             if (controls.containsKey(b)) keyPressed(controls.get(b), ' ', 0);
             else                         screen52.sendKeys(new String(new byte[] {(byte)b}));
-            testChanged();
+            cursorMoved();
         }
         @Override
         public void keyPressed(int keyCode, char keyChar, int modifiers) {
             keyDepressed(keyCode, keyChar, modifiers);
-            testChanged();
+            cursorMoved();
         }
 
         // 5250 writing to the screen