Package com.google.gwt.event.dom.client
Class KeyCodeEvent<H extends EventHandler>
- java.lang.Object
-
- com.google.web.bindery.event.shared.Event<H>
-
- com.google.gwt.event.shared.GwtEvent<H>
-
- com.google.gwt.event.dom.client.DomEvent<H>
-
- com.google.gwt.event.dom.client.KeyEvent<H>
-
- com.google.gwt.event.dom.client.KeyCodeEvent<H>
-
- Type Parameters:
H
- handler type
- All Implemented Interfaces:
HasNativeEvent
- Direct Known Subclasses:
KeyDownEvent
,KeyUpEvent
public abstract class KeyCodeEvent<H extends EventHandler> extends KeyEvent<H>
Key up and key down are both events based upon a given key code.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.gwt.event.dom.client.DomEvent
DomEvent.Type<H extends EventHandler>
-
-
Constructor Summary
Constructors Constructor Description KeyCodeEvent()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getNativeKeyCode()
Gets the native key code.static boolean
isArrow(int keyCode)
Does the key code represent an arrow key?boolean
isDownArrow()
Is this a key down arrow?boolean
isLeftArrow()
Is this a left arrow?boolean
isRightArrow()
Is this a right arrow?boolean
isUpArrow()
Is this a up arrow?java.lang.String
toDebugString()
This is a method used primarily for debugging.-
Methods inherited from class com.google.gwt.event.dom.client.KeyEvent
isAltKeyDown, isAnyModifierKeyDown, isControlKeyDown, isMetaKeyDown, isShiftKeyDown
-
Methods inherited from class com.google.gwt.event.dom.client.DomEvent
fireNativeEvent, fireNativeEvent, getAssociatedType, getNativeEvent, getRelativeElement, init, preventDefault, setNativeEvent, setRelativeElement, stopPropagation
-
-
-
-
Method Detail
-
isArrow
public static boolean isArrow(int keyCode)
Does the key code represent an arrow key?- Parameters:
keyCode
- the key code- Returns:
- if it is an arrow key code
-
getNativeKeyCode
public int getNativeKeyCode()
Gets the native key code. These key codes are enumerated in theKeyCodes
class.- Returns:
- the key code
-
isDownArrow
public boolean isDownArrow()
Is this a key down arrow?- Returns:
- whether this is a down arrow key event
-
isLeftArrow
public boolean isLeftArrow()
Is this a left arrow?- Returns:
- whether this is a left arrow key event
-
isRightArrow
public boolean isRightArrow()
Is this a right arrow?- Returns:
- whether this is a right arrow key event
-
isUpArrow
public boolean isUpArrow()
Is this a up arrow?- Returns:
- whether this is a right arrow key event
-
toDebugString
public java.lang.String toDebugString()
Description copied from class:Event
This is a method used primarily for debugging. It gives a string representation of the event details. This does not override the toString method because the compiler cannot always optimize toString out correctly. Event types should override as desired.- Overrides:
toDebugString
in classEvent<H extends EventHandler>
- Returns:
- a string representing the event's specifics.
-
-