Mercurial > 510Connectbot
comparison 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 |
comparison
equal
deleted
inserted
replaced
147:1350adb077b1 | 148:69333ca1563c |
---|---|
140 @Override | 140 @Override |
141 public void setField(int l, int c, char [] data) { | 141 public void setField(int l, int c, char [] data) { |
142 screen52.setField(l, c, data); | 142 screen52.setField(l, c, data); |
143 } | 143 } |
144 | 144 |
145 // terminal key listener found special key, send notification to monitor | |
146 @Override | |
147 public void monitorKey(boolean down) { | |
148 if (bridge.monitor != null) bridge.monitor.keyState(down); | |
149 } | |
150 | |
145 // terminal key listener sending to local screen | 151 // terminal key listener sending to local screen |
146 @Override | 152 @Override |
147 public void write(byte[] b) { | 153 public void write(byte[] b) { |
148 screen52.sendKeys(new String(b)); | 154 screen52.sendKeys(new String(b)); |
149 } | 155 } |
152 if (b == 120) { | 158 if (b == 120) { |
153 // special case x for testing | 159 // special case x for testing |
154 setField(17, 44, new char[] { '1', '2' }); | 160 setField(17, 44, new char[] { '1', '2' }); |
155 keyPressed(KEY_TAB, ' ', 0); | 161 keyPressed(KEY_TAB, ' ', 0); |
156 keyPressed(KEY_TAB, ' ', 0); | 162 keyPressed(KEY_TAB, ' ', 0); |
157 setField(-1, -1, new char[] { '2', '3' }); | 163 setField(-1, -1, new char[] { '3', '4' }); |
158 setField(18, 44, new char[0]); | 164 setField(18, 44, new char[0]); |
159 setField(-1, -1, new char[] { '4', '5' }); | 165 setField(-1, -1, new char[] { '5', '6' }); |
166 return; | |
167 } | |
168 if (b == 121) { | |
169 // special case y for testing | |
170 setField(17, 44, new char[0]); | |
171 setField(-1, -1, new char[] { '2', '1' }); | |
172 keyPressed(KEY_TAB, ' ', 0); | |
173 keyPressed(KEY_TAB, ' ', 0); | |
174 setField(-1, -1, new char[] { '4', '3' }); | |
175 setField(18, 44, new char[0]); | |
176 setField(-1, -1, new char[] { '6', '5' }); | |
160 return; | 177 return; |
161 } | 178 } |
162 if (controls.containsKey(b)) keyPressed(controls.get(b), ' ', 0); | 179 if (controls.containsKey(b)) keyPressed(controls.get(b), ' ', 0); |
163 else screen52.sendKeys(new String(new byte[] {(byte)b})); | 180 else screen52.sendKeys(new String(new byte[] {(byte)b})); |
164 } | 181 } |