diff --git a/src/sbbs3/inkey.cpp b/src/sbbs3/inkey.cpp index eb655a7af14571a84201b02866eabafbd6ddbe6f..2af3a12434af727db04643dc81fd304ca73286b0 100644 --- a/src/sbbs3/inkey.cpp +++ b/src/sbbs3/inkey.cpp @@ -392,12 +392,13 @@ char sbbs_t::handle_ctrlkey(char ch, long mode) } if(pause_inside) return '\r'; - } else if(button == '`') { + } else if(button == '`' && console&CON_MOUSE_SCROLL) { return TERM_KEY_UP; - } else if(button == 'a') { + } else if(button == 'a' && console&CON_MOUSE_SCROLL) { return TERM_KEY_DOWN; } - if(console&CON_MOUSE_PASSTHRU) { + if((button != 0x23 && console&CON_MOUSE_CLK_PASSTHRU) + || (button == 0x23 && console&CON_MOUSE_REL_PASSTHRU)) { for(j = i; j > 0; j--) ungetkey(str[j - 1], /* insert: */true); ungetkey('[', /* insert: */true); @@ -465,12 +466,13 @@ char sbbs_t::handle_ctrlkey(char ch, long mode) } if(pause_inside) return '\r'; - } else if(button == 0x40) { + } else if(button == 0x40 && console&CON_MOUSE_SCROLL) { return TERM_KEY_UP; - } else if(button == 0x41) { + } else if(button == 0x41 && console&CON_MOUSE_SCROLL) { return TERM_KEY_DOWN; } - if(console&CON_MOUSE_PASSTHRU) { + if((ch == 'M' && console&CON_MOUSE_CLK_PASSTHRU) + || (ch == 'm' && console&CON_MOUSE_REL_PASSTHRU)) { lprintf(LOG_DEBUG, "Passing-through SGR mouse report: 'ESC[<%s'", str); for(j = i; j > 0; j--) ungetkey(str[j - 1], /* insert: */true); @@ -478,7 +480,7 @@ char sbbs_t::handle_ctrlkey(char ch, long mode) ungetkey('[', /* insert: */true); return(ESC); } - if(button == 2) // Right-click + if(ch == 'M' && button == 2) // Right-click return handle_ctrlkey(TERM_KEY_ABORT, mode); #ifdef _DEBUG lprintf(LOG_DEBUG, "Eating SGR mouse report: 'ESC[<%s'", str); @@ -604,7 +606,7 @@ void sbbs_t::clear_hotspots(void) lprintf(LOG_DEBUG, "Clearing %ld mouse hot spots", spots); #endif listFreeNodes(&mouse_hotspots); - if(!(console&CON_MOUSE_REPORT)) + if(!(console&CON_MOUSE_SCROLL)) set_mouse(MOUSE_MODE_OFF); } } diff --git a/src/sbbs3/sbbsdefs.h b/src/sbbs3/sbbsdefs.h index c24e9745ee39dc758236f8ffd2920991eba9408c..0408bdef4f3f7a4260867e09e697da95a6f140c6 100644 --- a/src/sbbs3/sbbsdefs.h +++ b/src/sbbs3/sbbsdefs.h @@ -492,9 +492,10 @@ typedef enum { /* Values for xtrn_t.event */ #define CON_HIGH_FONT (1<<19) /* Alt high-intensity font activated */ #define CON_BLINK_FONT (1<<20) /* Alt blink attribute font activated */ #define CON_HBLINK_FONT (1<<21) /* Alt high-blink attribute font activated */ -#define CON_MOUSE_PASSTHRU (1<<24) // Pass-through unhandled mouse reports -#define CON_MOUSE_REPORT (1<<25) // Mouse-reports enabled for non-hotspots (e.g. scroll-wheel) -#define CON_CR_CLREOL (1<<31) // outchar('\r') clears to end-of-line first +#define CON_MOUSE_CLK_PASSTHRU (1<<24) // Pass-through unhandled mouse button-click reports +#define CON_MOUSE_REL_PASSTHRU (1<<25) // Pass-through unhandled mouse button-release reports +#define CON_MOUSE_SCROLL (1<<26) // Mouse-reports enabled for non-hotspots (e.g. scroll-wheel) +#define CON_CR_CLREOL (1<<31) // outchar('\r') clears to end-of-line first /* Number of milliseconds */ #define DELAY_AUTOHG 1500 /* Delay for auto-hangup (xfer) */