Behaviour when pressing the escape button

1 view
Skip to first unread message

pablisco

unread,
Mar 19, 2010, 6:24:37 PM3/19/10
to StreamHub Comet Server Community
Hi everyone,

I am doing some research in what is the best Comet technology
available. It's a shame that there is no standard... as always in web
techs.
My question came across when trying the demo found here:
http://www.stream-hub.com/demo/gwt-comet-visualization-api/stock-visualization-demo.html

When you press the escape key the connection is closed and the update
of the stock values stops in Chrome 5 Beta and Firefox 3.5 under
Linux.
I'm not sure if this is bug, but this is not a very favourable
behaviour since it would basically stop the application.

Does anybody know of a workaround or other technology that doesn't
have this weakness?

Thanks.

StreamHub Team

unread,
Mar 19, 2010, 6:45:03 PM3/19/10
to StreamHub Comet Server Community
Hi pablisco,

The solution is simple, catch the escape key press and stop the
propagation up the event stack:

window.onkeypress = function (e) {
if (e.keyCode == 27) {
return false;
}
};

However, since the escape key is a shortcut for the stop button in the
browser, one could argue that it is the correct behaviour to stop the
updates. Since when stopping a page you would expect the browser to
stop loading anything from the server.

It is really a user experience decision which should be left to the
application developers and not hard-coded by the Comet technology.

Thanks,
The StreamHub Team


On Mar 19, 10:24 pm, pablisco <pab...@googlemail.com> wrote:
> Hi everyone,
>
> I am doing some research in what is the best Comet technology
> available. It's a shame that there is no standard... as always in web
> techs.

> My question came across when trying the demo found here:http://www.stream-hub.com/demo/gwt-comet-visualization-api/stock-visu...

Kara Rawson

unread,
Mar 20, 2010, 4:00:12 PM3/20/10
to streamhub-comet-...@googlegroups.com
You could overload the keyevent for the esc. A suggestion could be when a user presses the e scape key, you terminate the current connection, and try to reconnect. Check for errors and prompt the user. This is in essence almost a type of soft restart of the web app.

kara

--
You received this message because you are subscribed to the Google Groups "StreamHub Comet Server Community" group.
To post to this group, send an email to streamhub-comet-...@googlegroups.com.
To unsubscribe from this group, send email to streamhub-comet-server...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/streamhub-comet-server-community?hl=en-GB.


Reply all
Reply to author
Forward
0 new messages