diff --git a/src/syncterm/CHANGES b/src/syncterm/CHANGES index 2ce504b9f4750c66a363c18739be4e0b3be23932..8f232f7c387763677b38ce79cbcc4a413fc08c61 100644 --- a/src/syncterm/CHANGES +++ b/src/syncterm/CHANGES @@ -21,6 +21,7 @@ Improve startup behaviour on Windows Allow hardware scaling in X11, GDI, and SDL modes Support XTerm Bracketed Paste Add -b and -n command-line options for BBS list and INI file respectively +Add ALT-O to toggle remote mouse support (to enable copy/paste locally) Version 1.1 ----------- diff --git a/src/syncterm/menu.c b/src/syncterm/menu.c index 31378dd4ad1007fce88543cc8af2d524035852dd..7f403c8331576ebd52805d812b7ac7efa80c2d96 100644 --- a/src/syncterm/menu.c +++ b/src/syncterm/menu.c @@ -156,7 +156,8 @@ syncmenu(struct bbslist *bbs, int *speed) "Capture Control ("ALT_KEY_NAMEP "-C)", "ANSI Music Control ("ALT_KEY_NAMEP "-M)", "Font Setup ("ALT_KEY_NAMEP "-F)", - "Toggle Doorway Mode" + "Toggle Doorway Mode", + "Toggle Remote Mouse (" ALT_KEY_NAMEP "-O)" #ifndef WITHOUT_OOII , "Toggle Operation Overkill ][ Mode" #endif @@ -196,6 +197,7 @@ syncmenu(struct bbslist *bbs, int *speed) "`ANSI Music` Enables/Disables ANSI Music\n" "`Font` Changes the current font (when supported)\n" "`Doorway Mode` Toggles the current DoorWay (keyboard input) setting\n" + "`Remote Mouse` Toggles remote mouse events\n" #ifndef WITHOUT_OOII "`Operation Overkill ][ Mode`\n" " Toggles the current Operation Overkill ][ setting\n" diff --git a/src/syncterm/term.c b/src/syncterm/term.c index 214a076c7d295155f402f39a183cded666437f43..a725f4825f70abccd882fffb04f74ec4a77e3e90 100644 --- a/src/syncterm/term.c +++ b/src/syncterm/term.c @@ -116,6 +116,7 @@ struct mouse_state { uint32_t flags; #define MS_FLAGS_SGR (1 << 0) +#define MS_FLAGS_DISABLED (1 << 1) #define MS_SGR_SET (1006) enum mouse_modes mode; }; @@ -124,7 +125,7 @@ void setup_mouse_events(struct mouse_state *ms) { ciomouse_setevents(0); - if (ms) { + if (ms && ((ms->flags & MS_FLAGS_DISABLED) == 0)) { switch (ms->mode) { case MM_RIP: ciomouse_addevent(CIOLIB_BUTTON_1_PRESS); @@ -345,10 +346,13 @@ update_status(struct bbslist *bbs, int speed, int ooii_mode, bool ata_inv) time_t now; static time_t lastupd = 0; static int oldspeed = 0; + static int lastmouse = 0; + int newmouse; int timeon; char sep; int oldfont_norm; int oldfont_bright; + struct mouse_state *ms = cterm->mouse_state_change_cbdata; if (term.nostatus) return; @@ -374,12 +378,14 @@ update_status(struct bbslist *bbs, int speed, int ooii_mode, bool ata_inv) sep = '|'; } now = time(NULL); - if ((now == lastupd) && (speed == oldspeed)) { + newmouse = ((ms->mode == MM_OFF) ? 1 : 0) | (ms->flags & MS_FLAGS_DISABLED); + if ((now == lastupd) && (speed == oldspeed) && (newmouse == lastmouse)) { setfont(oldfont_norm, 0, 1); setfont(oldfont_bright, 0, 2); return; } lastupd = now; + lastmouse = newmouse; oldspeed = speed; if (now > (bbs->connected + 359999)) timeon = 350000; @@ -481,6 +487,11 @@ update_status(struct bbslist *bbs, int speed, int ooii_mode, bool ata_inv) } if (wherex() - term.y + 1 >= term.width) clreol(); + if (ms->mode != 0) { + gotoxy(31, 1); + ciolib_setcolour((ms->flags & MS_FLAGS_DISABLED) ? 8 : 11, 4); + putch('M'); + } _wscroll = oldscroll; setfont(oldfont_norm, 0, 1); setfont(oldfont_bright, 0, 2); @@ -4094,6 +4105,13 @@ doterm(struct bbslist *bbs) showmouse(); key = 0; break; + case 0x1800: /* ALT-O */ + ms.flags ^= MS_FLAGS_DISABLED; + setup_mouse_events(&ms); + showmouse(); + key = 0; + sleep = false; + break; case 0x1600: /* ALT-U - Upload */ begin_upload(bbs, false, inch); setup_mouse_events(&ms); @@ -4191,11 +4209,16 @@ doterm(struct bbslist *bbs) case 10: cterm->doorway_mode = !cterm->doorway_mode; break; + case 11: + ms.flags ^= MS_FLAGS_DISABLED; + setup_mouse_events(&ms); + showmouse(); + break; #ifdef WITHOUT_OOII - case 11: + case 12: #else - case 11: + case 12: ooii_mode++; if (ooii_mode > MAX_OOII_MODE) { xptone_close(); @@ -4205,7 +4228,7 @@ doterm(struct bbslist *bbs) xptone_open(); } break; - case 12: + case 13: #endif scrollback_pos = cterm->backpos; cterm_clearscreen(cterm, cterm->attr); /* Clear screen into @@ -4218,9 +4241,9 @@ doterm(struct bbslist *bbs) hold_update = oldmc; return true; #ifdef WITHOUT_OOII - case 12: -#else case 13: +#else + case 14: #endif { struct ciolib_screen *savscrn;