Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Main
Synchronet
Commits
b0eea9bf
Commit
b0eea9bf
authored
Sep 25, 2019
by
deuce
Browse files
Fix ch = getkey, return getkey() bug in last commit.
Add some paranoia.
parent
a3f120a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
30 deletions
+33
-30
exec/dorkit/local_console.js
exec/dorkit/local_console.js
+33
-30
No files found.
exec/dorkit/local_console.js
View file @
b0eea9bf
...
...
@@ -13,40 +13,43 @@ if (js.global.conio !== undefined && dk.console.local) {
var
ch
;
if
(
conio
.
kbhit
)
{
ch
=
conio
.
getch
();
if
(
ch
===
0
)
{
ch
=
conio
.
getch
();
switch
(
ch
)
{
case
0x47
:
return
dk
.
console
.
key
.
KEY_HOME
;
case
72
:
return
dk
.
console
.
key
.
KEY_UP
;
case
0x4f
:
return
dk
.
console
.
key
.
KEY_END
;
case
80
:
return
dk
.
console
.
key
.
KEY_DOWN
;
case
0x52
:
return
dk
.
console
.
key
.
KEY_INS
;
case
0x53
:
return
dk
.
console
.
key
.
KEY_DEL
;
case
0x4b
:
return
dk
.
console
.
key
.
KEY_LEFT
;
case
0x4d
:
return
dk
.
console
.
key
.
KEY_RIGHT
;
case
0x49
:
return
dk
.
console
.
key
.
KEY_PGUP
;
case
0x51
:
return
dk
.
console
.
key
.
KEY_PGDOWN
;
default
:
if
(
ch
>=
0x3a
&&
ch
<=
0x44
)
return
dk
.
console
.
key
[
'
KEY_F
'
+
(
ch
-
0x39
)];
if
(
ch
>=
0x7a
&&
ch
<=
0x7b
)
return
dk
.
console
.
key
[
'
KEY_F
'
+
(
ch
-
0x6f
)];
if
(
conio
.
kbhit
())
{
ch
=
conio
.
getch
();
switch
(
ch
)
{
case
0x47
:
return
dk
.
console
.
key
.
KEY_HOME
;
case
72
:
return
dk
.
console
.
key
.
KEY_UP
;
case
0x4f
:
return
dk
.
console
.
key
.
KEY_END
;
case
80
:
return
dk
.
console
.
key
.
KEY_DOWN
;
case
0x52
:
return
dk
.
console
.
key
.
KEY_INS
;
case
0x53
:
return
dk
.
console
.
key
.
KEY_DEL
;
case
0x4b
:
return
dk
.
console
.
key
.
KEY_LEFT
;
case
0x4d
:
return
dk
.
console
.
key
.
KEY_RIGHT
;
case
0x49
:
return
dk
.
console
.
key
.
KEY_PGUP
;
case
0x51
:
return
dk
.
console
.
key
.
KEY_PGDOWN
;
default
:
if
(
ch
>=
0x3a
&&
ch
<=
0x44
)
return
dk
.
console
.
key
[
'
KEY_F
'
+
(
ch
-
0x39
)];
if
(
ch
>=
0x7a
&&
ch
<=
0x7b
)
return
dk
.
console
.
key
[
'
KEY_F
'
+
(
ch
-
0x6f
)];
}
}
return
;
return
undefined
;
}
return
ascii
(
conio
.
getch
());
return
ascii
(
ch
);
}
return
undefined
;
});
}
var
dk_local_console_loaded
=
true
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment