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
93e3fd8d
Commit
93e3fd8d
authored
23 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Added support for global hot key external programs/modules.
parent
9155f781
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/sbbs3/inkey.cpp
+7
-0
7 additions, 0 deletions
src/sbbs3/inkey.cpp
src/sbbs3/scfgdefs.h
+7
-0
7 additions, 0 deletions
src/sbbs3/scfgdefs.h
src/sbbs3/scfglib2.c
+25
-0
25 additions, 0 deletions
src/sbbs3/scfglib2.c
src/sbbs3/scfgsave.c
+9
-0
9 additions, 0 deletions
src/sbbs3/scfgsave.c
with
48 additions
and
0 deletions
src/sbbs3/inkey.cpp
+
7
−
0
View file @
93e3fd8d
...
...
@@ -108,6 +108,13 @@ char sbbs_t::inkey(long mode)
if
(
ch
<
SP
)
{
/* Control chars */
if
(
ch
==
LF
)
/* ignore LF's in not in raw mode */
return
(
0
);
for
(
i
=
0
;
i
<
cfg
.
total_hotkeys
;
i
++
)
if
(
cfg
.
hotkey
[
i
]
->
key
==
ch
)
break
;
if
(
i
<
cfg
.
total_hotkeys
)
{
external
(
cfg
.
hotkey
[
i
]
->
cmd
,
0
);
return
(
0
);
}
if
(
ch
==
CTRL_O
)
{
/* Ctrl-O toggles pause temporarily */
useron
.
misc
^=
UPAUSE
;
return
(
0
);
}
...
...
This diff is collapsed.
Click to expand it.
src/sbbs3/scfgdefs.h
+
7
−
0
View file @
93e3fd8d
...
...
@@ -335,6 +335,11 @@ typedef struct { /* Command Shells */
}
shell_t
;
typedef
struct
{
uchar
key
;
char
cmd
[
LEN_CMD
+
1
];
}
hotkey_t
;
typedef
struct
{
DWORD
size
;
/* sizeof(scfg_t) */
...
...
@@ -394,6 +399,8 @@ typedef struct
ushort
total_gurus
;
/* Total number of guru files */
shell_t
**
shell
;
/* Command shells */
ushort
total_shells
;
/* Total number of command shells */
hotkey_t
**
hotkey
;
/* Global hot keys */
ushort
total_hotkeys
;
/* Total number of global hot keys */
/* COM port registers: */
ushort
com_base
,
/* COM base address */
...
...
This diff is collapsed.
Click to expand it.
src/sbbs3/scfglib2.c
+
25
−
0
View file @
93e3fd8d
...
...
@@ -625,6 +625,31 @@ BOOL read_xtrn_cfg(scfg_t* cfg, read_cfg_text_t* txt)
if
(
feof
(
instream
))
break
;
get_int
(
cfg
->
natvpgm
[
i
]
->
misc
,
instream
);
}
/*******************/
/* Global Hot Keys */
/*******************/
get_int
(
cfg
->
total_hotkeys
,
instream
);
if
(
cfg
->
total_hotkeys
)
{
if
((
cfg
->
hotkey
=
(
hotkey_t
**
)
MALLOC
(
sizeof
(
hotkey_t
*
)
*
cfg
->
total_hotkeys
))
==
NULL
)
return
allocerr
(
txt
,
offset
,
fname
,
sizeof
(
hotkey_t
*
)
*
cfg
->
total_hotkeys
);
}
else
cfg
->
hotkey
=
NULL
;
for
(
i
=
0
;
i
<
cfg
->
total_hotkeys
;
i
++
)
{
if
(
feof
(
instream
))
break
;
if
((
cfg
->
hotkey
[
i
]
=
(
hotkey_t
*
)
MALLOC
(
sizeof
(
hotkey_t
)))
==
NULL
)
return
allocerr
(
txt
,
offset
,
fname
,
sizeof
(
hotkey_t
));
memset
(
cfg
->
hotkey
[
i
],
0
,
sizeof
(
hotkey_t
));
get_int
(
cfg
->
hotkey
[
i
]
->
key
,
instream
);
get_str
(
cfg
->
hotkey
[
i
]
->
cmd
,
instream
);
for
(
j
=
0
;
j
<
8
;
j
++
)
get_int
(
n
,
instream
);
}
cfg
->
total_hotkeys
=
i
;
fclose
(
instream
);
if
(
txt
->
readit
&&
txt
->
readit
[
0
])
...
...
This diff is collapsed.
Click to expand it.
src/sbbs3/scfgsave.c
+
9
−
0
View file @
93e3fd8d
...
...
@@ -1007,6 +1007,15 @@ BOOL DLLCALL write_xtrn_cfg(scfg_t* cfg, int backup_level)
for
(
i
=
0
;
i
<
cfg
->
total_natvpgms
;
i
++
)
put_int
(
cfg
->
natvpgm
[
i
]
->
misc
,
stream
);
put_int
(
cfg
->
total_hotkeys
,
stream
);
for
(
i
=
0
;
i
<
cfg
->
total_hotkeys
;
i
++
)
{
put_int
(
cfg
->
hotkey
[
i
]
->
key
,
stream
);
put_str
(
cfg
->
hotkey
[
i
]
->
cmd
,
stream
);
n
=
0
;
for
(
j
=
0
;
j
<
8
;
j
++
)
put_int
(
n
,
stream
);
}
fclose
(
stream
);
return
(
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