Mercurial > 510Connectbot
diff src/com/five_ten_sg/connectbot/transport/TN5250.java @ 175:2a7199ad90be
send cursor movement caused by user keystrokes to the monitor
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Wed, 02 Jul 2014 10:13:15 -0700 |
parents | 9d6b581b4656 |
children | cdaaa53b5eca |
line wrap: on
line diff
--- a/src/com/five_ten_sg/connectbot/transport/TN5250.java Tue Jul 01 20:53:08 2014 -0700 +++ b/src/com/five_ten_sg/connectbot/transport/TN5250.java Wed Jul 02 10:13:15 2014 -0700 @@ -101,6 +101,18 @@ mnemonics.put(KEY_F10 , "[pf10]"); mnemonics.put(KEY_F11 , "[pf11]"); mnemonics.put(KEY_F12 , "[pf12]"); + mnemonics.put(KEY_F13 , "[pf13]"); + mnemonics.put(KEY_F14 , "[pf14]"); + mnemonics.put(KEY_F15 , "[pf15]"); + mnemonics.put(KEY_F16 , "[pf16]"); + mnemonics.put(KEY_F17 , "[pf17]"); + mnemonics.put(KEY_F18 , "[pf18]"); + mnemonics.put(KEY_F19 , "[pf19]"); + mnemonics.put(KEY_F20 , "[pf20]"); + mnemonics.put(KEY_F21 , "[pf21]"); + mnemonics.put(KEY_F22 , "[pf22]"); + mnemonics.put(KEY_F23 , "[pf23]"); + mnemonics.put(KEY_F24 , "[pf24]"); mnemonics.put(KEY_UP , "[up]"); mnemonics.put(KEY_DOWN , "[down]"); mnemonics.put(KEY_LEFT , "[left]"); @@ -146,6 +158,15 @@ screen52.setField(l, c, data); } + // monitor simulating key depress + @Override + public void keyDepressed(int keyCode, char keyChar, int modifiers) { + if (mnemonics.containsKey(keyCode)) { + String s = mnemonics.get(keyCode); + if (s != "") screen52.sendKeys(s); + } + } + // terminal key listener found special key, send notification to monitor @Override public void monitorKey(boolean down) { @@ -156,19 +177,20 @@ @Override public void write(byte[] b) { screen52.sendKeys(new String(b)); + testChanged(); } @Override public void write(int b) { if (controls.containsKey(b)) keyPressed(controls.get(b), ' ', 0); else screen52.sendKeys(new String(new byte[] {(byte)b})); + testChanged(); } @Override public void keyPressed(int keyCode, char keyChar, int modifiers) { - if (mnemonics.containsKey(keyCode)) { - String s = mnemonics.get(keyCode); - if (s != "") screen52.sendKeys(s); - } + keyDepressed(keyCode, keyChar, modifiers); + testChanged(); } + // 5250 writing to the screen // test for changed screen contents @Override