Fixes a doc error (KEYCODE_* constants no longer exist) and clarifies which keys one can expect from which events. Patch by: bobv Review by: jgw git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@944 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/src/com/google/gwt/user/client/ui/KeyboardListener.java b/user/src/com/google/gwt/user/client/ui/KeyboardListener.java index 8a1f874..68410dc 100644 --- a/user/src/com/google/gwt/user/client/ui/KeyboardListener.java +++ b/user/src/com/google/gwt/user/client/ui/KeyboardListener.java
@@ -1,12 +1,12 @@ /* - * Copyright 2006 Google Inc. - * + * Copyright 2007 Google Inc. + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -45,10 +45,10 @@ /** * Fired when the user depresses a physical key. - * + * * @param sender the widget that was focused when the event occurred. * @param keyCode the physical key that was depressed. Constants for this - * value are defined in this interface with the KEYCODE prefix. + * value are defined in this interface with the KEY prefix. * @param modifiers the modifier keys pressed at when the event occurred. This * value is a combination of the bits defined by * {@link KeyboardListener#MODIFIER_SHIFT}, @@ -60,7 +60,15 @@ /** * Fired when a keyboard action generates a character. This occurs after * onKeyDown and onKeyUp are fired for the physical key that was pressed. - * + * + * <p> + * It should be noted that many browsers do not generate keypress events + * for non-printing keyCode values, such as {@link KeyboardListener#KEY_ENTER} + * or arrow keys. These keyCodes can be reliably captured either with + * {@link KeyboardListener#onKeyDown(Widget, char, int)} or + * {@link KeyboardListener#onKeyUp(Widget, char, int)}. + * </p> + * * @param sender the widget that was focused when the event occurred. * @param keyCode the Unicode character that was generated by the keyboard * action. @@ -74,10 +82,10 @@ /** * Fired when the user releases a physical key. - * + * * @param sender the widget that was focused when the event occurred. * @param keyCode the physical key that was released. Constants for this value - * are defined in this interface with the KEYCODE prefix. + * are defined in this interface with the KEY prefix. * @param modifiers the modifier keys pressed at when the event occurred. This * value is a combination of the bits defined by * {@link KeyboardListener#MODIFIER_SHIFT},