diff src/com/five_ten_sg/connectbot/transport/TN5250.java @ 148:69333ca1563c

add ptt button p2 preference
author Carl Byington <carl@five-ten-sg.com>
date Sun, 22 Jun 2014 13:02:36 -0700
parents 1350adb077b1
children 83bb2734b14c
line wrap: on
line diff
--- a/src/com/five_ten_sg/connectbot/transport/TN5250.java	Sun Jun 22 07:57:20 2014 -0700
+++ b/src/com/five_ten_sg/connectbot/transport/TN5250.java	Sun Jun 22 13:02:36 2014 -0700
@@ -142,6 +142,12 @@
             screen52.setField(l, c, data);
         }
 
+        // terminal key listener found special key, send notification to monitor
+        @Override
+        public void monitorKey(boolean down) {
+            if (bridge.monitor != null) bridge.monitor.keyState(down);
+        }
+
         // terminal key listener sending to local screen
         @Override
         public void write(byte[] b) {
@@ -154,9 +160,20 @@
                 setField(17, 44, new char[] { '1', '2' });
                 keyPressed(KEY_TAB, ' ', 0);
                 keyPressed(KEY_TAB, ' ', 0);
-                setField(-1, -1, new char[] { '2', '3' });
+                setField(-1, -1, new char[] { '3', '4' });
                 setField(18, 44, new char[0]);
-                setField(-1, -1, new char[] { '4', '5' });
+                setField(-1, -1, new char[] { '5', '6' });
+                return;
+            }
+            if (b == 121) {
+                // special case y for testing
+                setField(17, 44, new char[0]);
+                setField(-1, -1, new char[] { '2', '1' });
+                keyPressed(KEY_TAB, ' ', 0);
+                keyPressed(KEY_TAB, ' ', 0);
+                setField(-1, -1, new char[] { '4', '3' });
+                setField(18, 44, new char[0]);
+                setField(-1, -1, new char[] { '6', '5' });
                 return;
             }
             if (controls.containsKey(b)) keyPressed(controls.get(b), ' ', 0);