Skip to content
Snippets Groups Projects
Commit c038798f authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Add/use K_RIGHTEXIT and CON_RIGHTARROW

for getstr() to be able to return when user right-arrows off end of string
(for use in msgeditor).
parent 803ef760
No related branches found
No related tags found
No related merge requests found
......@@ -42,7 +42,7 @@ size_t sbbs_t::getstr(char *strout, size_t maxlen, int mode, const str_list_t hi
int org_lbuflen = lbuflen;
int term = term_supports();
console&=~(CON_UPARROW|CON_DOWNARROW|CON_LEFTARROW|CON_BACKSPACE|CON_DELETELINE);
console&=~(CON_UPARROW|CON_DOWNARROW|CON_LEFTARROW|CON_RIGHTARROW|CON_BACKSPACE|CON_DELETELINE);
if(!(mode&K_WRAP))
console&=~CON_INSERT;
sys_status&=~SS_ABORT;
......@@ -125,6 +125,10 @@ size_t sbbs_t::getstr(char *strout, size_t maxlen, int mode, const str_list_t hi
console|=CON_DOWNARROW;
break;
}
if(ch==TERM_KEY_RIGHT && (mode & K_RIGHTEXIT) && i == l) {
console |= CON_RIGHTARROW;
break;
}
if(ch==TAB && (mode&K_TAB || (!(mode&K_WRAP) && history == NULL))) /* TAB same as CR */
break;
if(!i && (mode&(K_UPRLWR|K_TRIM)) && (ch==' ' || ch==TAB))
......
......@@ -485,6 +485,7 @@ typedef enum { /* Values for xtrn_t.event */
#define CON_PAUSEOFF (1<<4) // Temporary pause over-ride (same as UPAUSE)
#define CON_L_INPUT (1<<5) /* Accept input locally */
#define CON_RAW_IN (1<<8) /* Raw input mode - no editing capabilities */
#define CON_RIGHTARROW (1<<9) /* Right arrow hit, exiting from getstr() */
#define CON_ECHO_OFF (1<<10) /* Remote & Local echo disabled for ML/MF */
#define CON_UPARROW (1<<11) /* Up arrow hit - move up one line */
#define CON_DOWNARROW (1<<12) /* Down arrow hit, exiting from getstr() */
......@@ -665,6 +666,7 @@ typedef enum { /* Values for xtrn_t.event */
#define K_CTRLKEYS (1<<24) /* No control-key handling/eating in inkey()*/
#define K_NUL (1<<25) /* Return NOINP on timeout instead of '\0' */
#define K_UTF8 (1<<26) /* Don't translate UTF-8 input into CP437 */
#define K_RIGHTEXIT (1<<27) /* Allow exit by arrowing right */
/* Bits in 'mode' for putmsg and printfile */
#define P_NONE 0 /* No mode flags */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment