Dear Javascript Experts,
I'm currently implementing Anyterm, a terminal emulator on a web page.
It consists of an Apache module, some XmlHTTP and a bit of Javascript.
The idea is to give you shell access to your server from (almost)
anywhere; other solutions to the problem tend to require access to
ports other than 80 and Java. The very primitive first attempt is at
http://chezphil.org/anyterm/. A more functional version will be
available soon.
My "problem for the day" is how to send control characters. For
example, if the user types Ctrl-D I need to send byte 4 to the server.
There are two sub-problems: first, some of these actions will be
intercepted by the browser so I need to do anything I can to avoid that
and/or provide an alternative entry mechanism (eg press ALT for CTRL).
Second, I need a piece of reasonably browser-independent code that
takes a keypress event, looks at all of its properties, and returns a
byte.
I'm hoping that someone has already done this and can point me at some
existing code. Otherwise, all suggestions are welcome.
Regards,
--Phil.