Skip to content

Commit

Permalink
Fix #85 - implement mouse tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
davidrg committed Sep 19, 2022
1 parent 3a4dbec commit d1c7203
Show file tree
Hide file tree
Showing 8 changed files with 431 additions and 11 deletions.
39 changes: 39 additions & 0 deletions kermit/k95/ckoco3.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ extern int tttapi;
#ifdef KUI
extern CKFLOAT tt_linespacing[VNUM];
#endif /* KUI */
#ifdef OS2MOUSE
extern int mouse_reporting_mode;
#endif /* OS2MOUSE */
extern long speed, vernum;
extern int local, escape, duplex, parity, flow, seslog, pmask,
cmdmsk, cmask, sosi, xitsta, debses, mdmtyp, carrier, what;
Expand Down Expand Up @@ -14207,6 +14210,18 @@ vtcsi(void)
break;
case 9: /* DECINLM - Interlace */
/* XTERM - Send Mouse X & Y on button press */
#ifdef OS2MOUSE
if (ISLINUX(tt_type_mode) || ISANSI(tt_type_mode)) {
/* The linux console terminal, as well as many
* other terminal emulators, implement XTERM
* mouse tracking */

if (mouse_reporting_mode != MOUSEREPORTING_DISABLE) {
debug(F100, "X10 mouse tracking now ON", "", 0);
mouse_reporting_mode = MOUSEREPORTING_X10;
}
}
#endif
break;
case 10: /* DECEDM - Block Mode On */
break;
Expand Down Expand Up @@ -14406,6 +14421,12 @@ vtcsi(void)
break;
case 1000:
/* XTERM - Send Mouse X&Y on button press and release */
#ifdef OS2MOUSE
if (mouse_reporting_mode != MOUSEREPORTING_DISABLE) {
debug(F100, "X11 (xterm) mouse tracking now ON", "", 0);
mouse_reporting_mode = MOUSEREPORTING_X11;
}
#endif
break;
case 1001:
/* XTERM - Use Hilite Mouse Tracking */
Expand Down Expand Up @@ -14762,6 +14783,18 @@ vtcsi(void)
break;
case 9: /* DECINLM - Interlace */
/* XTERM - Don't Send Mouse X&Y on button press */
#ifdef OS2MOUSE
if (ISLINUX(tt_type_mode) || ISANSI(tt_type_mode)) {
/* The linux console terminal, as well as many
* other terminal emulators, implement XTERM
* mouse tracking */

if (mouse_reporting_mode != MOUSEREPORTING_DISABLE) {
debug(F100, "X10 mouse tracking now OFF", "", 0);
mouse_reporting_mode = MOUSEREPORTING_NONE;
}
}
#endif
break;
case 10: /* DECEDM - Block mode off */
break;
Expand Down Expand Up @@ -14930,6 +14963,12 @@ vtcsi(void)
break;
case 1000:
/* XTERM - Don't Send Mouse X&Y on button press and release */
#ifdef OS2MOUSE
if (mouse_reporting_mode != MOUSEREPORTING_DISABLE) {
debug(F100, "X11 mouse tracking now OFF", "", 0);
mouse_reporting_mode = MOUSEREPORTING_NONE;
}
#endif
break;
case 1001:
/* XTERM - Don't use Hilite Mouse Tracking */
Expand Down
7 changes: 7 additions & 0 deletions kermit/k95/ckokey.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,13 @@ struct keynode {
#define MMSIZE (MMBUTTONMAX * MMEVENTSIZE) /* Mouse Map Size */

extern con_event mousemap[MMBUTTONMAX][MMSIZE] ;

/* Mouse tracking modes */
#define MOUSEREPORTING_NONE 0
#define MOUSEREPORTING_X10 1
#define MOUSEREPORTING_X11 2
#define MOUSEREPORTING_DISABLE 3
#define MOUSE_REPORTING_ACTIVE(x, vmode) ((x == MOUSEREPORTING_X10 || x == MOUSEREPORTING_X11) && vmode == VTERM)
#endif /* OS2MOUSE */

#define KEY_SCAN 0x0100
Expand Down
Loading

0 comments on commit d1c7203

Please sign in to comment.