Package com.google.gwt.event.dom.client
Class KeyEvent<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>
-
- Type Parameters:
H- The event handler type
- All Implemented Interfaces:
HasNativeEvent
- Direct Known Subclasses:
KeyCodeEvent,KeyPressEvent
public abstract class KeyEvent<H extends EventHandler> extends DomEvent<H>
Base class for Key events. The native keyboard events are somewhat a mess (http://www.quirksmode.org/js/keys.html), we do some trivial normalization here, but do not attempt any complex patching, so user be warned.
-
-
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 KeyEvent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisAltKeyDown()Is thealtkey down?booleanisAnyModifierKeyDown()Does this event have any modifier keys down? Specifically.booleanisControlKeyDown()Is thecontrolkey down?booleanisMetaKeyDown()Is themetakey down?booleanisShiftKeyDown()Is theshiftkey down?-
Methods inherited from class com.google.gwt.event.dom.client.DomEvent
fireNativeEvent, fireNativeEvent, getAssociatedType, getNativeEvent, getRelativeElement, init, preventDefault, setNativeEvent, setRelativeElement, stopPropagation
-
Methods inherited from class com.google.gwt.event.shared.GwtEvent
assertLive, dispatch, getSource, isLive, kill, revive
-
Methods inherited from class com.google.web.bindery.event.shared.Event
setSource, toDebugString, toString
-
-
-
-
Method Detail
-
isAltKeyDown
public boolean isAltKeyDown()
Is thealtkey down?- Returns:
- whether the alt key is down
-
isAnyModifierKeyDown
public boolean isAnyModifierKeyDown()
Does this event have any modifier keys down? Specifically. is the control, meta, shift, or alt key currently pressed?- Returns:
- whether this event have any modifier key down
-
isControlKeyDown
public boolean isControlKeyDown()
Is thecontrolkey down?- Returns:
- whether the control key is down
-
isMetaKeyDown
public boolean isMetaKeyDown()
Is themetakey down?- Returns:
- whether the meta key is down
-
isShiftKeyDown
public boolean isShiftKeyDown()
Is theshiftkey down?- Returns:
- whether the shift key is down
-
-