Hmm, it'll be a challenge.  I'd probably start here to see if it's
even possible to prevent the default action of the specific keys you
care about:

http://www.quirksmode.org/dom/events/tests/keys.html

Here's PPK's JavaScript for that page:

http://www.quirksmode.org/js/events/eventtests.js

On Dec 11, 6:10 am, Jeff Larsen <[email protected]> wrote:
> Thanks for the information. It is a huge help. After re-reading my
> message I realize I wasn't entirely clear on my meaning.
>
> I need to be able to stop the browser window from doing a refresh when
> F5 is hit. Not maximize when F11 is hit etc, no new window when Ctrl+N
> is hit.
>
> On Dec 10, 6:37 pm, Jim Douglas <[email protected]> wrote:
>
>
>
> > Jeff,
>
> > This sample shows the basic concept:
>
> >http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/g...
>
> > It gets more complicated when you need to handle ctrl keys and special
> > keys across multiple browsers and on multiple platforms (I'm in the
> > middle of it right now, and I want to kill the Opera developer who
> > decided to reverse the meanings of ctrlKey and metaKey on the Mac).
>
> > This page is a major lifeline for me:
>
> >http://unixpapa.com/js/testkey.html
>
> > Load that page in every operating system / browser combination you
> > have, press the keys you care about, note the set of information
> > returned by the keydown and keypress events, then reconcile the
> > information for all platform combinations.
>
> > Here are some GWT methods that you might find helpful if you have to
> > dig into the underlying native events:
>
> >     protected native char getWhich(NativeEvent e)/*-{
> >       return e.which;
> >     }-*/;
>
> >     protected native char getCharCode(NativeEvent e)/*-{
> >       return e.charCode;
> >     }-*/;
>
> >     protected native char getKeyCode(NativeEvent e)/*-{
> >       return e.keyCode;
> >     }-*/;
>
> > Those methods will make more sense as you play 
> > withhttp://unixpapa.com/js/testkey.html
> > and review the accompanying article onhttp://unixpapa.com/js/key.html.
>
> > To use the methods, do something like this:
>
> >     char which = getWhich(event.getNativeEvent());
>
> > Jim.
>
> > On Dec 10, 2:44 pm, Jeff Larsen <[email protected]> wrote:
>
> > > Hi, I have a requirement to implement keyboard bindings like Ctrl+N,
> > > F11 etc. I was wondering how I can go about grabbing these events
> > > before the browser grabs them.

--

You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.


Reply via email to