Mercurial > 510Connectbot
comparison src/com/five_ten_sg/connectbot/transport/TN5250.java @ 145:4dfa4dd791c1
testing setfield functions
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Sat, 21 Jun 2014 17:18:06 -0700 |
parents | 03af90a2f0a9 |
children | 1350adb077b1 |
comparison
equal
deleted
inserted
replaced
144:03af90a2f0a9 | 145:4dfa4dd791c1 |
---|---|
60 | 60 |
61 private Screen5250 screen52; | 61 private Screen5250 screen52; |
62 private tnvt handler = null; | 62 private tnvt handler = null; |
63 private Socket socket; | 63 private Socket socket; |
64 private boolean connected = false; | 64 private boolean connected = false; |
65 private TerminalKeyListener keyListener = null; | |
66 | 65 |
67 static final Pattern hostmask; | 66 static final Pattern hostmask; |
68 static { | 67 static { |
69 hostmask = Pattern.compile("^([0-9a-z.-]+)(:(\\d+))?$", Pattern.CASE_INSENSITIVE); | 68 hostmask = Pattern.compile("^([0-9a-z.-]+)(:(\\d+))?$", Pattern.CASE_INSENSITIVE); |
70 } | 69 } |
152 } | 151 } |
153 @Override | 152 @Override |
154 public void write(int b) { | 153 public void write(int b) { |
155 if (b == 120) { | 154 if (b == 120) { |
156 // special case x for testing | 155 // special case x for testing |
157 KeyEvent event = new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_F3); | 156 setField(17, 44, new char[] { '1', '2' }); |
158 keyListener.onKey(bridge.parent, event.getKeyCode(), event); | 157 keyPressed(KEY_TAB, ' ', 0); |
158 keyPressed(KEY_TAB, ' ', 0); | |
159 setField(-1, -1, new char[] { '2', '3' }); | |
160 setField(18, 44, new char[0]); | |
161 setField(-1, -1, new char[] { '4', '5' }); | |
159 return; | 162 return; |
160 } | 163 } |
161 if (controls.containsKey(b)) { | 164 if (controls.containsKey(b)) { |
162 keyPressed(controls.get(b), ' ', 0); | 165 keyPressed(controls.get(b), ' ', 0); |
163 } | 166 } |
449 // we don't use a relay thread between the transport and the vt320 buffer | 452 // we don't use a relay thread between the transport and the vt320 buffer |
450 return false; | 453 return false; |
451 } | 454 } |
452 | 455 |
453 public TerminalKeyListener getTerminalKeyListener() { | 456 public TerminalKeyListener getTerminalKeyListener() { |
454 keyListener = new TerminalKeyListener(manager, bridge, buffer, host.getEncoding()); | 457 return new TerminalKeyListener(manager, bridge, buffer, host.getEncoding()); |
455 return keyListener; | |
456 } | 458 } |
457 | 459 |
458 } | 460 } |