comparison app/src/main/java/de/mud/terminal/vt320.java @ 496:f698820bffdf

add socket2 monitor protocol
author Carl Byington <carl@five-ten-sg.com>
date Sun, 05 Jun 2022 14:46:41 -0700
parents d29cce60f393
children
comparison
equal deleted inserted replaced
495:c7a947e291db 496:f698820bffdf
63 */ 63 */
64 public void testChanged() { 64 public void testChanged() {
65 /* do nothing by default */ 65 /* do nothing by default */
66 } 66 }
67 67
68 /** 68 // monitor injecting a field
69 * inject field contents as if typed
70 */
71 public void setField(int l, int c, char [] d) { 69 public void setField(int l, int c, char [] d) {
72 // ignore line and column, just send the bytes to the host. 70 // ignore line and column, just send the bytes to the host.
73 int n = d.length; 71 int n = d.length;
74 byte [] b = new byte [n]; 72 byte [] b = new byte [n];
75 73
76 for (int i = 0; i < n; i++) b[i] = (byte)(d[i] & 0x00ff); 74 for (int i = 0; i < n; i++) b[i] = (byte)(d[i] & 0x00ff);
77 75
78 write(b); 76 write(b);
79 } 77 }
80 78
79 // monitor simulating function key depress
80 public void keyDepressed(int keyCode) {
81 keyPressed(keyCode, ' ', 0);
82 }
83
84 // monitor simulating ascii key depress
85 public void keyUnicodeDepressed(int keyCode) {
86 write((byte)(keyCode & 0x00ff));
87 }
88
81 public void monitorKey(boolean down) { 89 public void monitorKey(boolean down) {
82 // do nothing 90 // do nothing
83 }
84
85 public void keyDepressed(int keyCode, char keyChar, int modifiers) {
86 keyPressed(keyCode, keyChar, modifiers);
87 } 91 }
88 92
89 /** 93 /**
90 * Play the beep sound ... 94 * Play the beep sound ...
91 */ 95 */