Re: Re: Slyedit
By: Digital Man to deon on Fri Jan 22 2021 11:31 am
> Re: Re: Slyedit
> By: deon to Digital Man on Fri Jan 22 2021 10:34 pm
>
> > Re: Re: Slyedit
> > By: Digital Man to deon on Thu Jan 21 2021 09:39 pm
> >
> > DM> These appear to be the relevant lines, in SlyEdit.js:
>
> > So I had a play and didnt get anywhere. (SlyEdit uses getkey(), not
> > inkey()).
>
> > require("sbbsdefs.js", "K_NOCRLF");
>
> > foo = console.getkey(K_NUL);
> > writeln('GETKEY (K_NULL): ['+JSON.stringify(foo)+']
> > ('+foo.charCodeAt(0)+')'); bar = console.getkey(K_NONE);
> > writeln('GETKEY (K_NONE): ['+JSON.stringify(bar)+']
> > ('+bar.charCodeAt(0)+')');
>
> > foo = console.inkey(K_NUL,10000);
> > writeln('INKEY (K_NULL): ['+JSON.stringify(foo)+']
> > ('+foo.charCodeAt(0)+')'); bar = console.inkey(K_NONE,10000);
> > writeln('INKEY (K_NONE): ['+JSON.stringify(bar)+']
> > ('+bar.charCodeAt(0)+')'); console.pause();
>
>
> > So I put together this script and ran it with ;exec ?testkey
>
> > And got this result:
> > GETKEY (K_NULL): ["\u000d"] (13)
> > GETKEY (K_NONE): ["\u000d"] (13)
> > INKEY (K_NULL): [""] (NaN)
> > INKEY (K_NONE): [""] (NaN)
>
> > The first 2 times I pressed CTRL-Space and nothing happened, so I pressed
> > enter (hence the 0x0d).
>
> > The next two times, I only pressed CTRL-Space and they both yieled the
> > same result.
>
> > Have I missed something?
>
> The K_NUL optoin won't do anything different with older builds of sbbs. Did
> you get and build the latest sbbs code from git?
And here's th script I used to test it:
load("sbbsdefs.js");
var result = console.inkey(K_NUL, 5000);
print(typeof result);
print(result);
I don't have a terminal handy with an obvious method of sending an ASCII NUL (0), but I certainly got different results upon timeout (as expected) when using the new K_NUL mode flag and the new sbbs.
--
digital man
Sling Blade quote #6:
Karl: he should've had a chance to grow up. He would had fun some time.
Norco, CA WX: 63.9øF, 57.0% humidity, 1 mph W wind, 0.00 inches rain/24hrs
--- SBBSecho 3.12-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
|