comparison src/com/five_ten_sg/connectbot/service/TerminalMonitor.java @ 212:4ecd8a39afb3

cursor movement reporting changes
author Carl Byington <carl@five-ten-sg.com>
date Mon, 07 Jul 2014 12:32:22 -0700
parents 7e4352b53f24
children 2dd627df4dfb
comparison
equal deleted inserted replaced
211:7e4352b53f24 212:4ecd8a39afb3
52 private int start_line = 0; // monitor part of the screen for changes 52 private int start_line = 0; // monitor part of the screen for changes
53 private int end_line = 500; // "" 53 private int end_line = 500; // ""
54 private int start_column = 0; // "" 54 private int start_column = 0; // ""
55 private int end_column = 500; // "" 55 private int end_column = 500; // ""
56 private boolean modified = false; // used to delay screen change notifications 56 private boolean modified = false; // used to delay screen change notifications
57 private boolean moved = false; // used to delay cursor moved notifications
58 private int to_line = 0; // "" 57 private int to_line = 0; // ""
59 private int to_column = 0; // "" 58 private int to_column = 0; // ""
60 private HashMap<Integer, Integer> keymap = null; // map MS VK_ keys to vt320 virtual keys 59 private HashMap<Integer, Integer> keymap = null; // map MS VK_ keys to vt320 virtual keys
61 private IBinder bound = null; 60 private IBinder bound = null;
62 private Socket monitor_socket = null; 61 private Socket monitor_socket = null;
361 arg[2] = (char)((down) ? 1 : 0); 360 arg[2] = (char)((down) ? 1 : 0);
362 monitorWrite(MONITOR_CMD_KEYSTATE, arg); 361 monitorWrite(MONITOR_CMD_KEYSTATE, arg);
363 } 362 }
364 363
365 public synchronized void cursorMove(int l, int c) { 364 public synchronized void cursorMove(int l, int c) {
366 moved = true;
367 to_line = l; 365 to_line = l;
368 to_column = c; 366 to_column = c;
369 } 367 }
370 368
371 public void cursorMoved() { 369 public void cursorMoved() {
377 375
378 public synchronized void testChanged() { 376 public synchronized void testChanged() {
379 if (modified) { 377 if (modified) {
380 modified = false; 378 modified = false;
381 sendScreen(MONITOR_CMD_SCREENCHANGE); 379 sendScreen(MONITOR_CMD_SCREENCHANGE);
382 }
383
384 if (moved) {
385 moved = false;
386 cursorMoved(); 380 cursorMoved();
387 } 381 }
388 } 382 }
389 383
390 public synchronized void screenChanged(int llow, int lhigh, int clow, int chigh) { 384 public synchronized void screenChanged(int llow, int lhigh, int clow, int chigh) {
448 } 442 }
449 443
450 444
451 public synchronized void cursorRequest() { 445 public synchronized void cursorRequest() {
452 Log.i(TAG, "cursorRequest()"); 446 Log.i(TAG, "cursorRequest()");
453 testChanged(); 447 cursorMoved();
454 } 448 }
455 449
456 } 450 }