Commit 077eadbc authored by rswindell's avatar rswindell
Browse files

Some users have complained about moue support being enabled by default,

so made it enabled/disabled per-user-terminal settings. This means that if
you were already enjoying mouse support, you're going to have to turn it on
to keep enjoying it. It also means there's currently no way to enable/use
mouse support pre-logon, but I have ideas about how to support that for
sysops that want that.
parent 89c1439a
......@@ -519,7 +519,7 @@ long sbbs_t::term_supports(long cmp_flags)
long flags = ((sys_status&SS_USERON) && !(useron.misc&AUTOTERM)) ? useron.misc : autoterm;
if((sys_status&SS_USERON) && (useron.misc&AUTOTERM))
flags |= useron.misc & (NO_EXASCII | SWAP_DELETE | COLOR | ICE_COLOR);
flags |= useron.misc & (NO_EXASCII | SWAP_DELETE | COLOR | ICE_COLOR | MOUSE);
return(cmp_flags ? ((flags&cmp_flags)==cmp_flags) : (flags&TERM_FLAGS));
}
......
......@@ -390,7 +390,7 @@ char sbbs_t::handle_ctrlkey(char ch, long mode)
return handle_ctrlkey(TERM_KEY_ABORT, mode);
return 0;
}
if(pause_inside)
if(pause_inside && y == rows - 1)
return '\r';
} else if(button == '`' && console&CON_MOUSE_SCROLL) {
return TERM_KEY_UP;
......@@ -464,7 +464,7 @@ char sbbs_t::handle_ctrlkey(char ch, long mode)
return handle_ctrlkey(TERM_KEY_ABORT, mode);
return 0;
}
if(pause_inside)
if(pause_inside && y == rows - 1)
return '\r';
} else if(button == 0x40 && console&CON_MOUSE_SCROLL) {
return TERM_KEY_UP;
......@@ -559,7 +559,7 @@ char sbbs_t::handle_ctrlkey(char ch, long mode)
void sbbs_t::set_mouse(long flags)
{
if(term_supports(ANSI)) {
if(term_supports(ANSI|MOUSE)) {
long mode = mouse_mode & ~flags;
if(mode & MOUSE_MODE_X10) ansi_mouse(ANSI_MOUSE_X10, false);
if(mode & MOUSE_MODE_NORM) ansi_mouse(ANSI_MOUSE_NORM, false);
......
......@@ -80,10 +80,12 @@ bool sbbs_t::logon()
if(useron.rest&FLAG('G')) { /* Guest account */
useron.misc=(cfg.new_misc&(~ASK_NSCAN));
useron.rows=0;
useron.misc&=~(ANSI|RIP|NO_EXASCII|COLOR|PETSCII);
useron.misc &= ~TERM_FLAGS;
useron.misc|=autoterm;
if(!(useron.misc&(ANSI|PETSCII)) && text[AnsiTerminalQ][0] && yesno(text[AnsiTerminalQ]))
useron.misc|=ANSI;
if((useron.misc&ANSI) && text[MouseTerminalQ][0] && yesno(text[MouseTerminalQ]))
useron.misc|=MOUSE;
if((useron.misc&RIP) || !(cfg.uq&UQ_COLORTERM)
|| (useron.misc&(ANSI|PETSCII) && yesno(text[ColorTerminalQ])))
useron.misc|=COLOR;
......
......@@ -165,6 +165,10 @@ BOOL sbbs_t::newuser()
useron.misc|=COLOR;
else
useron.misc&=~COLOR;
if(text[MouseTerminalQ][0] && yesno(text[MouseTerminalQ]))
useron.misc |= MOUSE;
else
useron.misc &= ~MOUSE;
}
else
useron.rows = TERM_ROWS_DEFAULT;
......
......@@ -668,8 +668,9 @@ typedef enum { /* Values for xtrn_t.event */
#define SWAP_DELETE (1L<<27) /* Swap Delete and Backspace keys */
#define ICE_COLOR (1L<<28) /* Bright background color support */
#define UTF8 (1L<<29) /* UTF-8 terminal */
#define MOUSE (1L<<31) /* Mouse supported terminal */
#define TERM_FLAGS (ANSI|COLOR|NO_EXASCII|RIP|WIP|HTML|PETSCII|SWAP_DELETE|ICE_COLOR|UTF8)
#define TERM_FLAGS (ANSI|COLOR|RIP|WIP|HTML|SWAP_DELETE|ICE_COLOR|MOUSE|CHARSET_FLAGS)
#define CHARSET_FLAGS (NO_EXASCII|PETSCII|UTF8)
#define CHARSET_ASCII NO_EXASCII // US-ASCII
#define CHARSET_PETSCII PETSCII // CBM-ASCII
......
......@@ -841,6 +841,8 @@ enum {
,MsgPostedToYouVia
,Unlimited
,NodeConnectionRaw
,MouseTerminalQ
,TerminalMouse
,TOTAL_TEXT
};
......
......@@ -1351,7 +1351,7 @@ const char * const text_defaults[TOTAL_TEXT]={
"\x65\x63\x74\x65\x64\x2e\x0d\x0a" // 815 PetTerminalDetected
,"\x41\x72\x65\x20\x79\x6f\x75\x20\x75\x73\x69\x6e\x67\x20\x61\x20\x43\x42\x4d\x2f\x50\x45\x54\x53\x43\x49\x49\x20\x74\x65\x72\x6d"
"\x69\x6e\x61\x6c" // 816 PetTerminalQ
,"\x41\x75\x74\x6f\x20\x44\x65\x74\x65\x63\x74\x20" // 817 TerminalAutoDetect
,"\x41\x75\x74\x6f\x20" // 817 TerminalAutoDetect
,"\x63\x6f\x6c\x75\x6d\x6e\x73" // 818 TerminalColumns
,"\x72\x6f\x77\x73" // 819 TerminalRows
,"\x28\x6d\x6f\x6e\x6f\x29\x20" // 820 TerminalMonochrome
......@@ -1372,4 +1372,7 @@ const char * const text_defaults[TOTAL_TEXT]={
"\x6e\x20\x01\x68\x25\x73\x20\x01\x6e\x01\x6d\x25\x73\x0d\x0a" // 828 MsgPostedToYouVia
,"\x75\x6e\x6c\x69\x6d\x69\x74\x65\x64" // 829 Unlimited
,"\x20\x76\x69\x61\x20\x72\x61\x77" // 830 NodeConnectionRaw
,"\x44\x6f\x65\x73\x20\x79\x6f\x75\x72\x20\x74\x65\x72\x6d\x69\x6e\x61\x6c\x20\x73\x75\x70\x70\x6f\x72\x74\x20\x6d\x6f\x75\x73\x65"
"\x20\x72\x65\x70\x6f\x72\x74\x69\x6e\x67" // 831 MouseTerminalQ
,"\x28\x6d\x6f\x75\x73\x65\x29\x20" // 832 TerminalMouse
};
......@@ -806,11 +806,12 @@ void sbbs_t::maindflts(user_t* user)
,user->misc&AUTOTERM ? text[TerminalAutoDetect]:nulstr
,cols, text[TerminalColumns]);
else
safe_snprintf(str,sizeof(str),"%s%s / %s %s%s"
safe_snprintf(str,sizeof(str),"%s%s / %s %s%s%s"
,user->misc&AUTOTERM ? text[TerminalAutoDetect]:nulstr
,term_charset(term)
,term_type(term)
,term&COLOR ? (term&ICE_COLOR ? text[TerminalIceColor] : text[TerminalColor]) : text[TerminalMonochrome]
,term&MOUSE ? text[TerminalMouse] : ""
,term&SWAP_DELETE ? "DEL=BS" : nulstr);
add_hotspot('T');
bprintf(text[UserDefaultsTerminal], truncsp(str));
......@@ -950,6 +951,14 @@ void sbbs_t::maindflts(user_t* user)
} else
user->misc &= ~COLOR;
}
if(sys_status&SS_ABORT)
break;
if(term&ANSI) {
if(text[MouseTerminalQ][0] && yesno(text[MouseTerminalQ]))
user->misc |= MOUSE;
else
user->misc &= ~MOUSE;
}
if(sys_status&SS_ABORT)
break;
if(!(term&PETSCII)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment