mirror of
https://github.com/VARCem/PDCurses.git
synced 2026-09-23 23:35:20 +00:00
Support for timeout() and halfdelay()
This commit is contained in:
18
dos/pdckbd.c
18
dos/pdckbd.c
@@ -32,7 +32,7 @@
|
||||
|
||||
|
||||
#ifdef PDCDEBUG
|
||||
char *rcsid_PDCkbd = "$Id: pdckbd.c,v 1.6 2003/12/28 08:37:57 mark Exp $";
|
||||
char *rcsid_PDCkbd = "$Id: pdckbd.c,v 1.7 2004/01/01 07:47:09 mark Exp $";
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
@@ -453,6 +453,7 @@ extern WINDOW* _getch_win_;
|
||||
|
||||
int c=0;
|
||||
int oldc=0;
|
||||
bool return_immediately;
|
||||
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("PDC_rawgetch() - called\n");
|
||||
@@ -461,7 +462,12 @@ extern WINDOW* _getch_win_;
|
||||
if (_getch_win_ == (WINDOW *)NULL) /* @@ */
|
||||
return( -1 );
|
||||
|
||||
if (_getch_win_->_nodelay && !PDC_breakout()) /* @@ */
|
||||
if (SP->delaytenths || _getch_win_->_delayms || _getch_win_->_nodelay)
|
||||
return_immediately = TRUE;
|
||||
else
|
||||
return_immediately = FALSE;
|
||||
|
||||
if (return_immediately && !PDC_breakout())
|
||||
return( -1 );
|
||||
|
||||
while (1) /* loop to get valid char */
|
||||
@@ -574,6 +580,7 @@ extern WINDOW* _getch_win_;
|
||||
/* to _getch_win_ - marked with @@ */
|
||||
|
||||
int c=0;
|
||||
bool return_immediately;
|
||||
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("PDC_sysgetch() - called\n");
|
||||
@@ -582,7 +589,12 @@ extern WINDOW* _getch_win_;
|
||||
if (_getch_win_ == (WINDOW *)NULL) /* @@ */
|
||||
return (-1);
|
||||
|
||||
if (_getch_win_->_nodelay && !PDC_breakout())
|
||||
if (SP->delaytenths || _getch_win_->_delayms || _getch_win_->_nodelay)
|
||||
return_immediately = TRUE;
|
||||
else
|
||||
return_immediately = FALSE;
|
||||
|
||||
if (return_immediately && !PDC_breakout())
|
||||
return (-1);
|
||||
|
||||
while (1)
|
||||
|
||||
18
os2/pdckbd.c
18
os2/pdckbd.c
@@ -33,7 +33,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef PDCDEBUG
|
||||
char *rcsid_PDCkbd = "$Id: pdckbd.c,v 1.5 2002/09/01 08:13:48 mark Exp $";
|
||||
char *rcsid_PDCkbd = "$Id: pdckbd.c,v 1.6 2004/01/01 07:47:09 mark Exp $";
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
@@ -540,13 +540,19 @@ extern WINDOW* _getch_win_;
|
||||
|
||||
int c=0;
|
||||
int oldc=0;
|
||||
bool return_immediately;
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("PDC_rawgetch() - called\n");
|
||||
#endif
|
||||
if (_getch_win_ == (WINDOW *)NULL) /* @@ */
|
||||
return( -1 );
|
||||
|
||||
if (_getch_win_->_nodelay && !PDC_breakout()) /* @@ */
|
||||
if (SP->delaytenths || _getch_win_->_delayms || _getch_win_->_nodelay)
|
||||
return_immediately = TRUE;
|
||||
else
|
||||
return_immediately = FALSE;
|
||||
|
||||
if (return_immediately && !PDC_breakout())
|
||||
return( -1 );
|
||||
|
||||
while (1) /* loop to get valid char */
|
||||
@@ -651,13 +657,19 @@ extern WINDOW* _getch_win_;
|
||||
/* to _getch_win_ - marked with @@ */
|
||||
|
||||
int c=0;
|
||||
bool return_immediately;
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("PDC_sysgetch() - called\n");
|
||||
#endif
|
||||
if (_getch_win_ == (WINDOW *)NULL) /* @@ */
|
||||
return (-1);
|
||||
|
||||
if (_getch_win_->_nodelay && !PDC_breakout())
|
||||
if (SP->delaytenths || _getch_win_->_delayms || _getch_win_->_nodelay)
|
||||
return_immediately = TRUE;
|
||||
else
|
||||
return_immediately = FALSE;
|
||||
|
||||
if (return_immediately && !PDC_breakout())
|
||||
return (-1);
|
||||
|
||||
while (1)
|
||||
|
||||
Reference in New Issue
Block a user