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
637231c6
Commit
637231c6
authored
20 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Attempt to match leftover input fragments with control sequences.
parent
82815414
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/odoors/ODGetIn.c
+34
-3
34 additions, 3 deletions
src/odoors/ODGetIn.c
with
34 additions
and
3 deletions
src/odoors/ODGetIn.c
+
34
−
3
View file @
637231c6
...
...
@@ -445,12 +445,43 @@ FunctionExit:
/* if(szCurrentSequence[0] == 27 && strlen(szCurrentSequence) == 1)*/
if
(
szCurrentSequence
[
0
])
{
/* This is no longer actually KNOWN correct */
pInputEvent
->
bFromRemote
=
bSequenceFromRemote
;
/* This is already broken input... we'll assume it's remote */
/* as local codes are handle immediately in doorway mode. */
/* Further, we'll just grab the longest seq. that matches. */
int
matchlen
=
0
;
pInputEvent
->
bFromRemote
=
TRUE
;
pInputEvent
->
chKeyPress
=
szCurrentSequence
[
0
];
pInputEvent
->
EventType
=
EVENT_CHARACTER
;
if
(
!
(
wFlags
&
GETIN_RAW
))
{
/* Search for a matching control sequence. */
for
(
nMatchedSequence
=
0
;
nMatchedSequence
<
DIM
(
aKeySequences
);
++
nMatchedSequence
)
{
int
seqlen
;
/* Skip sequences that use control characters if required. */
if
((
wFlags
&
GETIN_RAWCTRL
)
&&
aKeySequences
[
nMatchedSequence
].
bIsControlKey
)
{
continue
;
}
seqlen
=
strlen
(
aKeySequences
[
nMatchedSequence
].
pszSequence
);
if
(
seqlen
>
matchlen
&&
strncmp
(
szCurrentSequence
,
aKeySequences
[
nMatchedSequence
].
pszSequence
,
seqlen
)
==
0
)
{
pInputEvent
->
chKeyPress
=
aKeySequences
[
nMatchedSequence
].
chExtendedKey
;
pInputEvent
->
EventType
=
EVENT_EXTENDED_KEY
;
matchlen
=
seqlen
;
}
}
}
/* Shift the sequence to the left */
memcpy
(
szCurrentSequence
,
szCurrentSequence
+
1
,
strlen
(
szCurrentSequence
));
if
(
matchlen
==
0
)
memcpy
(
szCurrentSequence
,
szCurrentSequence
+
1
,
strlen
(
szCurrentSequence
));
else
memcpy
(
szCurrentSequence
,
szCurrentSequence
+
matchlen
,
strlen
(
szCurrentSequence
)
-
matchlen
+
1
);
bGotEvent
=
TRUE
;
}
}
...
...
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