comparison src/com/five_ten_sg/connectbot/transport/TN5250.java @ 184:cdaaa53b5eca

setfield positions the cursor properly as if the characters were typed
author Carl Byington <carl@five-ten-sg.com>
date Wed, 02 Jul 2014 14:32:13 -0700
parents 2a7199ad90be
children c51bcf9f0516
comparison
equal deleted inserted replaced
183:97848d5dd28f 184:cdaaa53b5eca
179 screen52.sendKeys(new String(b)); 179 screen52.sendKeys(new String(b));
180 testChanged(); 180 testChanged();
181 } 181 }
182 @Override 182 @Override
183 public void write(int b) { 183 public void write(int b) {
184 if (b == 120) {
185 // special case x for testing
186 setField(17, 44, new char[] { '1', '2' });
187 keyPressed(KEY_TAB, ' ', 0);
188 keyPressed(KEY_TAB, ' ', 0);
189 setField(-1, -1, new char[] { '3', '4' });
190 setField(18, 44, new char[0]);
191 setField(-1, -1, new char[] { '5', '6' });
192 return;
193 }
194 if (b == 121) {
195 // special case y for testing
196 setField(17, 44, new char[0]);
197 setField(-1, -1, new char[] { '2', '1' });
198 keyPressed(KEY_TAB, ' ', 0);
199 keyPressed(KEY_TAB, ' ', 0);
200 setField(-1, -1, new char[] { '4', '3' });
201 setField(18, 44, new char[0]);
202 setField(-1, -1, new char[] { '6', '5' });
203 return;
204 }
205 if (b == 122) {
206 // special case z for testing
207 setField(17, 40, new char[0]);
208 return;
209 }
184 if (controls.containsKey(b)) keyPressed(controls.get(b), ' ', 0); 210 if (controls.containsKey(b)) keyPressed(controls.get(b), ' ', 0);
185 else screen52.sendKeys(new String(new byte[] {(byte)b})); 211 else screen52.sendKeys(new String(new byte[] {(byte)b}));
186 testChanged(); 212 testChanged();
187 } 213 }
188 @Override 214 @Override