diff --git a/src/odoors/ODCore.c b/src/odoors/ODCore.c index 1cd21827eee12d0faeafaeef41941bd0c5b0946a..1c8a125a5e6eb76b0e6ba2ab64e89aa1ba71ee4f 100644 --- a/src/odoors/ODCore.c +++ b/src/odoors/ODCore.c @@ -402,6 +402,37 @@ ODAPIDEF void ODCALL od_clear_keybuffer(void) OD_API_EXIT(); } +/* ---------------------------------------------------------------------------- + * od_key_pending() + * + * Returns TRUE if there's a key pending, FALSE otherwise. + * + * Parameters: none + * + * Return: TRUE if character is waiting, FALSE if no character is waiting. + */ +ODAPIDEF BOOL ODCALL od_key_pending(void) +{ + /* Initialize OpenDoors if it hasn't already been done. */ + if(!bODInitialized) od_init(); + + /* Log function entry if running in trace mode. */ + TRACE(TRACE_API, "od_get_key()"); + + OD_API_ENTRY(); + + /* Call the OpenDoors kernel. */ + CALL_KERNEL_IF_NEEDED(); + + if(!ODInQueueWaiting(hODInputQueue)) + { + OD_API_EXIT(); + return(FALSE); + } + + OD_API_EXIT(); + return(TRUE); +} /* ---------------------------------------------------------------------------- * od_get_key() diff --git a/src/odoors/ODoorW.lib b/src/odoors/ODoorW.lib index e3ea74ee7c91ee0d8f864ad5935d7c577cf1ccc8..0241af0ead7a10d345c7ccdad0933cff540376c4 100644 Binary files a/src/odoors/ODoorW.lib and b/src/odoors/ODoorW.lib differ diff --git a/src/odoors/ODoors62.dll b/src/odoors/ODoors62.dll index cb138f6645e445c2c4878895b95170c934f0faa0..38e5e5f525e5cea23046da1fb0399bfd436972cc 100644 Binary files a/src/odoors/ODoors62.dll and b/src/odoors/ODoors62.dll differ diff --git a/src/odoors/OpenDoor.h b/src/odoors/OpenDoor.h index 492283bab0d562df612a837f29b31c52216252bf..ef9aa3b32f8008c4564dd358419b302877911e53 100644 --- a/src/odoors/OpenDoor.h +++ b/src/odoors/OpenDoor.h @@ -915,6 +915,7 @@ od_control; * od_edit_str() - Fancy formatted string input function (ANS/AVT) * od_clear_keybuffer() - Removes any waiting keys in keyboard buffer * od_multiline_edit() - Edits text that spans multiple lines (ANS/AVT) + * od_key_pending() - Returns TRUE if a key is waiting to be processed * * COMMON DOOR ACTIVITY FUNCTIONS * od_page() - Allows user to page sysop @@ -962,6 +963,7 @@ ODAPIDEF char ODCALL od_get_answer(char *pszOptions); ODAPIDEF void ODCALL od_get_cursor(INT *pnRow, INT *pnColumn); ODAPIDEF BOOL ODCALL od_get_input(tODInputEvent *pInputEvent, tODMilliSec TimeToWait, WORD wFlags); +ODAPIDEF BOOL ODCALL od_key_pending(void); ODAPIDEF char ODCALL od_get_key(BOOL bWait); ODAPIDEF BOOL ODCALL od_gettext(INT nLeft, INT nTop, INT nRight, INT nBottom, void *pBlock);