Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
82815414
Commit
82815414
authored
20 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Don't discard input after a timeout sequence.
parent
f7a0cff0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/odoors/ODGetIn.c
+26
-21
26 additions, 21 deletions
src/odoors/ODGetIn.c
with
26 additions
and
21 deletions
src/odoors/ODGetIn.c
+
26
−
21
View file @
82815414
...
...
@@ -36,6 +36,7 @@
* Feb 27, 1996 6.00 BP Added od_max_key_latency.
* Mar 03, 1996 6.10 BP Begin version 6.10.
* Aug 10, 2003 6.23 SH *nix support
* Apr 11, 2005 6.23 SH Fix hang forver on ESC press and latency timeout.
*/
#define BUILDING_OPENDOORS
...
...
@@ -211,6 +212,9 @@ ODAPIDEF BOOL ODCALL od_get_input(tODInputEvent *pInputEvent,
/* some other reason. */
bGotEvent
=
FALSE
;
if
(
szCurrentSequence
[
0
])
goto
FunctionExit
;
while
(
!
bGotEvent
)
{
/* If we aren't supposed to wait for input, then fail if there is */
...
...
@@ -250,7 +254,7 @@ ODAPIDEF BOOL ODCALL od_get_input(tODInputEvent *pInputEvent,
(
bTimerActive
&&
ODTimerElapsed
(
&
SequenceFailTimer
)
/* 04/05 You can't expect ESC to be pressed and nothing else to follow */
/* && szCurrentSequence[0] == 27 && strlen(szCurrentSequence) == 1)) */
&&
szCurrentSequence
[
0
]
==
27
))
&&
szCurrentSequence
[
0
]))
{
/* If no input event could be obtained within the specified */
/* then return with failure. */
...
...
@@ -264,6 +268,7 @@ ODAPIDEF BOOL ODCALL od_get_input(tODInputEvent *pInputEvent,
{
bGotEvent
=
TRUE
;
memcpy
(
pInputEvent
,
&
LastInputEvent
,
sizeof
(
tODInputEvent
));
ODGetInResetSequence
();
}
else
{
...
...
@@ -277,6 +282,7 @@ ODAPIDEF BOOL ODCALL od_get_input(tODInputEvent *pInputEvent,
pInputEvent
->
chKeyPress
=
LastInputEvent
.
chKeyPress
;
pInputEvent
->
EventType
=
EVENT_EXTENDED_KEY
;
bGotEvent
=
TRUE
;
ODGetInResetSequence
();
break
;
}
else
if
(
LastInputEvent
.
chKeyPress
==
'\0'
)
...
...
@@ -360,6 +366,7 @@ ODAPIDEF BOOL ODCALL od_get_input(tODInputEvent *pInputEvent,
aKeySequences
[
nMatchedSequence
].
chExtendedKey
;
pInputEvent
->
EventType
=
EVENT_EXTENDED_KEY
;
bGotEvent
=
TRUE
;
ODGetInResetSequence
();
break
;
}
...
...
@@ -404,6 +411,7 @@ ODAPIDEF BOOL ODCALL od_get_input(tODInputEvent *pInputEvent,
{
bGotEvent
=
TRUE
;
memcpy
(
pInputEvent
,
&
LastInputEvent
,
sizeof
(
tODInputEvent
));
ODGetInResetSequence
();
}
}
}
...
...
@@ -425,29 +433,26 @@ FunctionExit:
aKeySequences
[
nMatchedSequence
].
chExtendedKey
;
pInputEvent
->
EventType
=
EVENT_EXTENDED_KEY
;
bGotEvent
=
TRUE
;
}
else
{
/* If the sequence began with an escape key, then return an escape */
/* key event. */
/* 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
];
pInputEvent
->
EventType
=
EVENT_CHARACTER
;
bGotEvent
=
TRUE
;
}
ODGetInResetSequence
();
}
}
}
/* On success, reset current sequence buffer. */
if
(
bGotEvent
)
{
ODGetInResetSequence
();
if
(
!
bGotEvent
)
{
/* If the sequence began with an escape key, then return an escape */
/* key event. */
/* 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
])
{
/* This is no longer actually KNOWN correct */
pInputEvent
->
bFromRemote
=
bSequenceFromRemote
;
pInputEvent
->
chKeyPress
=
szCurrentSequence
[
0
];
pInputEvent
->
EventType
=
EVENT_CHARACTER
;
/* Shift the sequence to the left */
memcpy
(
szCurrentSequence
,
szCurrentSequence
+
1
,
strlen
(
szCurrentSequence
));
bGotEvent
=
TRUE
;
}
}
/* Exit function with appropriate return value. */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment