changeset 208:561caa2f7c17

more testing on cursor movement
author Carl Byington <carl@five-ten-sg.com>
date Thu, 03 Jul 2014 19:34:07 -0700
parents 2c5c90e53c33
children 53f66625d618
files src/com/five_ten_sg/connectbot/transport/TN5250.java src/org/tn5250j/framework/tn5250/Screen5250.java
diffstat 2 files changed, 21 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/com/five_ten_sg/connectbot/transport/TN5250.java	Thu Jul 03 09:00:23 2014 -0700
+++ b/src/com/five_ten_sg/connectbot/transport/TN5250.java	Thu Jul 03 19:34:07 2014 -0700
@@ -181,6 +181,25 @@
         }
         @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();
--- a/src/org/tn5250j/framework/tn5250/Screen5250.java	Thu Jul 03 09:00:23 2014 -0700
+++ b/src/org/tn5250j/framework/tn5250/Screen5250.java	Thu Jul 03 19:34:07 2014 -0700
@@ -2660,16 +2660,8 @@
         ScreenField cf;
 
         if (l >= 0) {
-            int position = l * numCols + c;
-            if (!isInField(position, true)) {
-                lastPos = position;
-                while (!isInField()) advancePos();
-                cf = screenFields.getCurrentField();
-                lastPos = cf.getStartPos();
-            }
-            else {
-                lastPos = position;
-            }
+            lastPos = l * numCols + c;
+            while (!isInField()) advancePos();
             setDirty(lastPos);
             fireCursorChanged();
         }