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
39f9858a
Commit
39f9858a
authored
20 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Stop using *nix-only KEY_* macros... use CIO_KEY_* macros from uifc instead.
parent
75e75225
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/syncterm/menu.c
+28
-23
28 additions, 23 deletions
src/syncterm/menu.c
src/syncterm/term.c
+44
-40
44 additions, 40 deletions
src/syncterm/term.c
with
72 additions
and
63 deletions
src/syncterm/menu.c
+
28
−
23
View file @
39f9858a
#include
<uifc.h>
#include
<conio.h>
#include
<keys.h>
#include
"term.h"
#include
"uifcinit.h"
...
...
@@ -26,40 +27,44 @@ void viewscroll(void)
puttext
(
term
.
x
+
1
,
term
.
y
+
1
,
term
.
x
+
term
.
width
,
term
.
y
+
term
.
height
,
term
.
scrollback
+
(
term
.
width
*
2
*
top
));
key
=
getch
();
switch
(
key
)
{
case
0
:
switch
(
getch
()
<<
8
)
{
case
CIO_KEY_UP
:
top
--
;
break
;
case
CIO_KEY_DOWN
:
top
++
;
break
;
case
CIO_KEY_PPAGE
:
top
-=
term
.
height
;
break
;
case
CIO_KEY_NPAGE
:
top
+=
term
.
height
;
break
;
case
CIO_KEY_F
(
1
):
init_uifc
();
uifc
.
helpbuf
=
"`Scrollback Buffer`
\n\n
"
"~ J ~ or ~ Up Arrow ~ Scrolls up one line
\n
"
"~ K ~ or ~ Down Arrow ~ Scrolls down one line
\n
"
"~ H ~ or ~ Page Up ~ Scrolls up one screen
\n
"
"~ L ~ or ~ Page Down ~ Scrolls down one screen
\n
"
;
uifc
.
showhelp
();
uifcbail
();
drawwin
();
break
;
}
break
;
case
'j'
:
case
'J'
:
case
KEY_UP
:
top
--
;
break
;
case
'k'
:
case
'K'
:
case
KEY_DOWN
:
top
++
;
break
;
case
'h'
:
case
'H'
:
case
KEY_PPAGE
:
top
-=
term
.
height
;
break
;
case
'l'
:
case
'L'
:
case
KEY_NPAGE
:
top
+=
term
.
height
;
break
;
case
ESC
:
i
=
1
;
break
;
case
KEY_F
(
1
):
init_uifc
();
uifc
.
helpbuf
=
"`Scrollback Buffer`
\n\n
"
"~ J ~ or ~ Up Arrow ~ Scrolls up one line
\n
"
"~ K ~ or ~ Down Arrow ~ Scrolls down one line
\n
"
"~ H ~ or ~ Page Up ~ Scrolls up one screen
\n
"
"~ L ~ or ~ Page Down ~ Scrolls down one screen
\n
"
;
uifc
.
showhelp
();
uifcbail
();
drawwin
();
break
;
}
}
puttext
(
1
,
1
,
txtinfo
.
screenwidth
,
txtinfo
.
screenheight
,
buf
);
...
...
This diff is collapsed.
Click to expand it.
src/syncterm/term.c
+
44
−
40
View file @
39f9858a
#include
<genwrap.h>
#include
<conio.h>
#include
<keys.h>
#include
"term.h"
#include
"uifcinit.h"
...
...
@@ -576,6 +577,49 @@ void doterm(void)
while
(
kbhit
())
{
key
=
getch
();
switch
(
key
)
{
case
0
:
switch
(
getch
()
<<
8
)
{
case
CIO_KEY_LEFT
:
rlogin_send
(
"
\033
[D"
,
3
,
100
);
break
;
case
CIO_KEY_RIGHT
:
rlogin_send
(
"
\033
[C"
,
3
,
100
);
break
;
case
CIO_KEY_UP
:
rlogin_send
(
"
\033
[A"
,
3
,
100
);
break
;
case
CIO_KEY_DOWN
:
rlogin_send
(
"
\033
[B"
,
3
,
100
);
break
;
case
CIO_KEY_HOME
:
rlogin_send
(
"
\033
[H"
,
3
,
100
);
break
;
case
CIO_KEY_END
:
#ifdef CIO_KEY_SELECT
case
CIO_KEY_SELECT
:
/* Some terminfo/termcap entries use KEY_SELECT as the END key! */
#endif
rlogin_send
(
"
\033
[K"
,
3
,
100
);
break
;
case
CIO_KEY_F
(
1
):
rlogin_send
(
"
\033
OP"
,
3
,
100
);
break
;
case
CIO_KEY_F
(
2
):
rlogin_send
(
"
\033
OQ"
,
3
,
100
);
break
;
case
CIO_KEY_F
(
3
):
rlogin_send
(
"
\033
Ow"
,
3
,
100
);
break
;
case
CIO_KEY_F
(
4
):
rlogin_send
(
"
\033
Ox"
,
3
,
100
);
break
;
#ifdef __unix__
case
128
|
'S'
:
/* Under curses, ALT sets the high bit of the char */
case
128
|
's'
:
/* Under curses, ALT sets the high bit of the char */
viewscroll
();
break
;
#endif
}
break
;
case
17
:
/* CTRL-Q */
free
(
term
.
scrollback
);
return
;
...
...
@@ -589,46 +633,6 @@ void doterm(void)
}
gotoxy
(
i
,
j
);
break
;
case
KEY_LEFT
:
rlogin_send
(
"
\033
[D"
,
3
,
100
);
break
;
case
KEY_RIGHT
:
rlogin_send
(
"
\033
[C"
,
3
,
100
);
break
;
case
KEY_UP
:
rlogin_send
(
"
\033
[A"
,
3
,
100
);
break
;
case
KEY_DOWN
:
rlogin_send
(
"
\033
[B"
,
3
,
100
);
break
;
case
KEY_HOME
:
rlogin_send
(
"
\033
[H"
,
3
,
100
);
break
;
case
KEY_END
:
#ifdef KEY_SELECT
case
KEY_SELECT
:
/* Some terminfo/termcap entries use KEY_SELECT as the END key! */
#endif
rlogin_send
(
"
\033
[K"
,
3
,
100
);
break
;
case
KEY_F
(
1
):
rlogin_send
(
"
\033
OP"
,
3
,
100
);
break
;
case
KEY_F
(
2
):
rlogin_send
(
"
\033
OQ"
,
3
,
100
);
break
;
case
KEY_F
(
3
):
rlogin_send
(
"
\033
Ow"
,
3
,
100
);
break
;
case
KEY_F
(
4
):
rlogin_send
(
"
\033
Ox"
,
3
,
100
);
break
;
#ifdef __unix__
case
128
|
'S'
:
/* Under curses, ALT sets the high bit of the char */
case
128
|
's'
:
/* Under curses, ALT sets the high bit of the char */
viewscroll
();
break
;
#endif
case
KEY_BACKSPACE
:
case
'\b'
:
key
=
'\b'
;
/* FALLTHROUGH to default */
...
...
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