Skip to content
Snippets Groups Projects
Commit 46fb51f9 authored by rswindell's avatar rswindell
Browse files

inkey() now supports timeout value (defaults to 0).

Re-working spinning cursor code since no longer using mswait here.
parent b323b8bd
No related branches found
No related tags found
No related merge requests found
...@@ -68,12 +68,6 @@ char sbbs_t::getkey(long mode) ...@@ -68,12 +68,6 @@ char sbbs_t::getkey(long mode)
return(0); return(0);
} }
#if 0 // moved to inkey() on AUG-29-2001
if(sys_status&SS_SYSPAGE) {
sbbs_beep(sbbs_random(800),100);
}
#endif
if(mode&K_SPIN) if(mode&K_SPIN)
switch(spin) { switch(spin) {
case 0: case 0:
...@@ -82,25 +76,20 @@ char sbbs_t::getkey(long mode) ...@@ -82,25 +76,20 @@ char sbbs_t::getkey(long mode)
outchar(BS); outchar(BS);
outchar(''); outchar('');
break; break;
case 10: case 1:
outchar(BS); outchar(BS);
outchar('/'); outchar('/');
break; break;
case 20: case 2:
outchar(BS); outchar(BS);
outchar(''); outchar('');
break; break;
case 30: case 3:
outchar(BS); outchar(BS);
outchar('\\'); outchar('\\');
break;
case 40:
c=0; c=0;
break; break;
default: }
if(!(cfg.node_misc&NM_WINOS2))
mswait(DELAY_SPIN);
break; }
break; break;
case 1: case 1:
switch(c++) { switch(c++) {
...@@ -108,33 +97,28 @@ char sbbs_t::getkey(long mode) ...@@ -108,33 +97,28 @@ char sbbs_t::getkey(long mode)
outchar(BS); outchar(BS);
outchar(''); outchar('');
break; break;
case 10: case 1:
outchar(BS); outchar(BS);
outchar(''); outchar('');
break; break;
case 20: case 2:
outchar(BS); outchar(BS);
outchar(''); outchar('');
break; break;
case 30: case 3:
outchar(BS); outchar(BS);
outchar(''); outchar('');
break; break;
case 40: case 4:
outchar(BS); outchar(BS);
outchar(''); outchar('');
break; break;
case 50: case 5:
outchar(BS); outchar(BS);
outchar(''); outchar('');
break;
case 60:
c=0; c=0;
break; break;
default: }
if(!(cfg.node_misc&NM_WINOS2))
mswait(DELAY_SPIN);
break; }
break; break;
case 2: case 2:
switch(c++) { switch(c++) {
...@@ -142,25 +126,20 @@ char sbbs_t::getkey(long mode) ...@@ -142,25 +126,20 @@ char sbbs_t::getkey(long mode)
outchar(BS); outchar(BS);
outchar('-'); outchar('-');
break; break;
case 10: case 1:
outchar(BS); outchar(BS);
outchar('='); outchar('=');
break; break;
case 20: case 2:
outchar(BS); outchar(BS);
outchar(''); outchar('');
break; break;
case 30: case 3:
outchar(BS); outchar(BS);
outchar('='); outchar('=');
break;
case 40:
c=0; c=0;
break; break;
default: }
if(!(cfg.node_misc&NM_WINOS2))
mswait(DELAY_SPIN);
break; }
break; break;
case 3: case 3:
switch(c++) { switch(c++) {
...@@ -168,25 +147,20 @@ char sbbs_t::getkey(long mode) ...@@ -168,25 +147,20 @@ char sbbs_t::getkey(long mode)
outchar(BS); outchar(BS);
outchar(''); outchar('');
break; break;
case 10: case 1:
outchar(BS); outchar(BS);
outchar(''); outchar('');
break; break;
case 20: case 2:
outchar(BS); outchar(BS);
outchar(''); outchar('');
break; break;
case 30: case 3:
outchar(BS); outchar(BS);
outchar(''); outchar('');
break;
case 40:
c=0; c=0;
break; break;
default: }
if(!(cfg.node_misc&NM_WINOS2))
mswait(DELAY_SPIN);
break; }
break; break;
case 4: case 4:
switch(c++) { switch(c++) {
...@@ -194,30 +168,24 @@ char sbbs_t::getkey(long mode) ...@@ -194,30 +168,24 @@ char sbbs_t::getkey(long mode)
outchar(BS); outchar(BS);
outchar(''); outchar('');
break; break;
case 10: case 1:
outchar(BS); outchar(BS);
outchar(''); outchar('');
break; break;
case 20: case 2:
outchar(BS); outchar(BS);
outchar(''); outchar('');
break; break;
case 30: case 3:
outchar(BS); outchar(BS);
outchar(''); outchar('');
break;
case 40:
c=0; c=0;
break; break;
default:
if(!(cfg.node_misc&NM_WINOS2))
mswait(DELAY_SPIN);
break;
} }
break; break;
} }
ch=inkey(mode); ch=inkey(mode,mode&K_SPIN ? 250:1000);
if(sys_status&SS_ABORT) if(sys_status&SS_ABORT)
return(0); return(0);
now=time(NULL); now=time(NULL);
...@@ -304,6 +272,7 @@ char sbbs_t::getkey(long mode) ...@@ -304,6 +272,7 @@ char sbbs_t::getkey(long mode)
} }
} while(online); } while(online);
return(0); return(0);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment