Commit c187e140 authored by rswindell's avatar rswindell
Browse files

Introduce a user setting (misc flag) which informs sbbs that the terminal

will be sending 0x7f (DEL) when the backspace key is struck: SWAP_DELETE
For example, xterm sends 0x7f when backspace and hit and an ANSI escape
sequence when the DEL key is hit.

I don't yet have a way to *enable* this setting.

Also, allow the user's setting of NO_EXASCII to take effect even when
auto-terminal type detection is used (yes, the user's terminal can support
ANSI and *not* CP437).
parent 5ae8df25
......@@ -327,6 +327,9 @@ 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);
return(cmp_flags ? ((flags&cmp_flags)==cmp_flags) : (flags&TERM_FLAGS));
}
......
......@@ -70,8 +70,8 @@ char sbbs_t::inkey(long mode, unsigned long timeout)
ch&=0x7f;
this->timeout=time(NULL);
if(term_supports(PETSCII)) {
long term = term_supports();
if(term&PETSCII) {
switch(ch) {
case PETSCII_HOME:
return TERM_KEY_HOME;
......@@ -96,6 +96,17 @@ char sbbs_t::inkey(long mode, unsigned long timeout)
ch ^= 0x20; /* Swap upper/lower case */
}
if(term&SWAP_DELETE) {
switch(ch) {
case TERM_KEY_DELETE:
ch = '\b';
break;
case '\b':
ch = TERM_KEY_DELETE;
break;
}
}
/* Is this a control key */
if(ch<' ') {
if(cfg.ctrlkey_passthru&(1<<ch)) /* flagged as passthru? */
......
......@@ -653,8 +653,9 @@ typedef enum { /* Values for xtrn_t.event */
#define NOPAUSESPIN (1L<<24) /* No spinning cursor at pause prompt */
#define CTERM_FONTS (1L<<25) /* Loadable fonts are supported */
#define PETSCII (1L<<26) /* Commodore PET/CBM terminal */
#define SWAP_DELETE (1L<<27) /* Swap Delete and Backspace keys */
#define TERM_FLAGS (ANSI|COLOR|NO_EXASCII|RIP|WIP|HTML|CTERM_FONTS|PETSCII)
#define TERM_FLAGS (ANSI|COLOR|NO_EXASCII|RIP|WIP|HTML|CTERM_FONTS|PETSCII|SWAP_DELETE)
/* Special terminal key mappings */
#define TERM_KEY_HOME CTRL_B
......
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