Skip to content
Snippets Groups Projects
Commit 7aff3d36 authored by rswindell's avatar rswindell
Browse files

Define and use new input function mode bit (K_ANSI_CPR) that indicates we are

expecting an ANSI cursor position report and we will use this value to
determine the user's screen dimensions (currently, lines only).
parent 349d11cb
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2006 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -103,7 +103,7 @@ void sbbs_t::ansi_getlines()
&& online==ON_REMOTE) { /* Remote */
SYNC;
putcom("\x1b[s\x1b[99B\x1b[6n\x1b[u");
inkey(K_NONE,TIMEOUT_ANSI_GETXY*1000);
inkey(K_ANSI_CPR,TIMEOUT_ANSI_GETXY*1000);
}
}
......
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2007 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -312,7 +312,7 @@ char sbbs_t::handle_ctrlkey(char ch, long mode)
return(ESC);
}
if(ch=='R') { /* cursor position report */
if(i && !(useron.rows)) { /* auto-detect rows */
if(mode&K_ANSI_CPR && i && !(useron.rows)) { /* auto-detect rows */
str[i]=0;
rows=atoi(str);
lprintf(LOG_DEBUG,"Node %d ANSI cursor position report: %u rows"
......
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2008 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -679,6 +679,7 @@ typedef enum { /* Values for xtrn_t.event */
#define K_LEFTEXIT (1L<<19) /* Allow exit by backspacing/arrowing left */
#define K_USEOFFSET (1L<<20) /* Use getstr_offset for cursor position */
#define K_NOSPIN (1L<<21) /* Do not honor the user's spinning cursor */
#define K_ANSI_CPR (1L<<22) /* Expect ANSI Cursor Position Report */
/* Bits in 'mode' for putmsg and printfile */
#define P_NOABORT (1<<0) /* Disallows abortion of a message */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment