From f7a0cff0bbc2d77c2ccc5f999d90c0e557a9aeb0 Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Tue, 12 Apr 2005 19:02:28 +0000
Subject: [PATCH] Do not require sequences starting with an ESC to have a
 length of 1... This results in an input hang if a lone ESC is received and
 nothing else is received until the key latency is passed.

---
 src/odoors/ODGetIn.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/odoors/ODGetIn.c b/src/odoors/ODGetIn.c
index bc905510f2..3b57c4e386 100644
--- a/src/odoors/ODGetIn.c
+++ b/src/odoors/ODGetIn.c
@@ -248,7 +248,9 @@ ODAPIDEF BOOL ODCALL od_get_input(tODInputEvent *pInputEvent,
       {
          if(TimeToWait != OD_NO_TIMEOUT ||
             (bTimerActive && ODTimerElapsed(&SequenceFailTimer)
-            && szCurrentSequence[0] == 27 && strlen(szCurrentSequence) == 1))
+            /* 04/05 You can't expect ESC to be pressed and nothing else to follow */
+            /* && szCurrentSequence[0] == 27 && strlen(szCurrentSequence) == 1)) */
+            && szCurrentSequence[0] == 27))
          {
             /* If no input event could be obtained within the specified */
             /* then return with failure.                                */
@@ -428,7 +430,10 @@ FunctionExit:
          {
             /* If the sequence began with an escape key, then return an escape */
             /* key event.                                                      */
-            if(szCurrentSequence[0] == 27 && strlen(szCurrentSequence) == 1)
+            /* 04/05 - You need to store or dump the rest of the sequence...   */
+            /*         or it'll park here effectively forever!                 */
+            /* if(szCurrentSequence[0] == 27 && strlen(szCurrentSequence) == 1)*/
+            if(szCurrentSequence[0] == 27)
             {
                pInputEvent->bFromRemote = bSequenceFromRemote;
                pInputEvent->chKeyPress = szCurrentSequence[0];
-- 
GitLab