-
ESC key in user input
From
Nightfox@VERT/DIGDIST to
All on Sat Feb 6 18:02:34 2010
In writing JavaScript mods for Synchronet, I've noticed some oddness relatedãto checking for the ESC key in user input.ããI've noticed that there is no key variable defined for ESC in sbbsdefs.js, soãI've always defined it in my own scripts as "\x1b" (alternatively, defining theãESC key using ascii(27) also seems to work).ããIn one script where I use a lightbar user interface, checking for the ESC keyãapparently caused the script to quit unexpectedly when scrolling too fastãthrough the list of items by holding down the up or down arrow keys; theãproblem went away when I removed the check for the ESC key. I've also noticedãthat Synchronet JavaScript mods tend to take a second or two to respond to theãESC key, although I've seen that in other doors too, including older DOS doorsã(i.e., IceEdit).ããIs there an issue with checking for the ESC key in user input? Are the issuesãthat I've mentioned common, and are there any ways to get around them (besidesãnot checking for ESC)?ããNightfoxãã---ã þ Synchronet þ Digital Distortion BBS: digdist.bbsindex.comã
-
From
Digital Man@VERT to
Nightfox on Sun Feb 7 12:54:03 2010
Re: ESC key in user inputã By: Nightfox to All on Sat Feb 06 2010 06:02 pmãã > In writing JavaScript mods for Synchronet, I've noticed some oddnessã > related to checking for the ESC key in user input.ã >ã > I've noticed that there is no key variable defined for ESC in sbbsdefs.js,ã > so I've always defined it in my own scripts as "\x1b" (alternatively,ã > defining the ESC key using ascii(27) also seems to work).ã >ã > In one script where I use a lightbar user interface, checking for the ESCã > key apparently caused the script to quit unexpectedly when scrolling tooã > fast through the list of items by holding down the up or down arrow keys;ã > the problem went away when I removed the check for the ESC key. I've alsoã > noticed that Synchronet JavaScript mods tend to take a second or two toã > respond to the ESC key, although I've seen that in other doors too,ã > including older DOS doors (i.e., IceEdit).ã >ã > Is there an issue with checking for the ESC key in user input?ããYes. Terminal escape sequences (e.g. ANSI) often begin with the escape (ASCIIã27) character, for example <ESC>[2J to clear the screen.ãã > Are theã > issues that I've mentioned common, and are there any ways to get aroundã > them (besides not checking for ESC)?ããYou'd have use a timeout mechanism, which explains the delay you see in someãscripts/programs that support ESC as a command.ãã digital manããSnapple "Real Fact" #155:ãIn 1926, the first outdoor mini-golf courses were built on rooftops in NYC. ã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
-
From
Nightfox@VERT/DIGDIST to
Digital Man on Sun Feb 7 14:39:17 2010
Re: ESC key in user inputã By: Digital Man to Nightfox on Sun Feb 07 2010 12:54:03ãã > Yes. Terminal escape sequences (e.g. ANSI) often begin with the escape (ASCIã > 27) character, for example <ESC>[2J to clear the screen.ãã > You'd have use a timeout mechanism, which explains the delay you see in someã > scripts/programs that support ESC as a command.ããThanks.ããNightfoxãã---ã þ Synchronet þ Digital Distortion BBS: digdist.bbsindex.comã