@Generated(value="org.realityforge.webtack")
@JsType(isNative=true,
namespace="<global>",
name="KeyboardEvent")
public class KeyboardEvent
extends UIEvent
| Modifier and Type | Field and Description |
|---|---|
static int |
DOM_KEY_LOCATION_LEFT |
static int |
DOM_KEY_LOCATION_NUMPAD |
static int |
DOM_KEY_LOCATION_RIGHT |
static int |
DOM_KEY_LOCATION_STANDARD |
AT_TARGET, BUBBLING_PHASE, cancelBubble, CAPTURING_PHASE, NONE, returnValue| Constructor and Description |
|---|
KeyboardEvent(java.lang.String type)
The KeyboardEvent() constructor creates a new KeyboardEvent.
|
KeyboardEvent(java.lang.String type,
KeyboardEventInit eventInitDict)
The KeyboardEvent() constructor creates a new KeyboardEvent.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
altKey()
The KeyboardEvent.altKey read-only property is a Boolean that indicates if the alt key (Option or ⌥ on OS X) was pressed (true) or not (false) when the event occured.
|
int |
charCode()
The charCode read-only property of the KeyboardEvent interface returns the Unicode value of a character key pressed during a keypress event.
|
java.lang.String |
code()
The KeyboardEvent.code property represents a physical key on the keyboard (as opposed to the character generated by pressing the key).
|
boolean |
ctrlKey()
The KeyboardEvent.ctrlKey read-only property returns a Boolean that indicates if the control key was pressed (true) or not (false) when the event occured.
|
boolean |
getModifierState(java.lang.String keyArg)
The KeyboardEvent.getModifierState() method returns the current state of the specified modifier key: true if the modifier is active (that is the modifier key is pressed or locked), otherwise, false.
|
boolean |
isComposing()
The KeyboardEvent.isComposing read-only property returns a Boolean value indicating if the event is fired within a composition session, i.e.
|
java.lang.String |
key()
The KeyboardEvent interface's key read-only property returns the value of the key pressed by the user, taking into consideration the state of modifier keys such as Shift as well as the keyboard locale and layout.
|
int |
keyCode()
The deprecated KeyboardEvent.keyCode read-only property represents a system and implementation dependent numerical code identifying the unmodified value of the pressed key.
|
int |
location()
The KeyboardEvent.location read-only property returns an unsigned long representing the location of the key on the keyboard or other input device.
|
boolean |
metaKey()
The KeyboardEvent.metaKey read-only property returning a Boolean that indicates if the Meta key was pressed (true) or not (false) when the event occurred.
|
boolean |
repeat()
The repeat read-only property of the KeyboardEvent interface returns a Boolean that is true if the given key is being held down such that it is automatically repeating.
|
boolean |
shiftKey()
The KeyboardEvent.shiftKey read-only property is a Boolean that indicates if the shift key was pressed (true) or not (false) when the event occurred.
|
bubbles, cancelable, composed, composedPath, currentTarget, defaultPrevented, eventPhase, initEvent, initEvent, initEvent, isTrusted, preventDefault, srcElement, stopImmediatePropagation, stopPropagation, target, timeStamp, type@JsOverlay public static final int DOM_KEY_LOCATION_LEFT
@JsOverlay public static final int DOM_KEY_LOCATION_NUMPAD
@JsOverlay public static final int DOM_KEY_LOCATION_RIGHT
@JsOverlay public static final int DOM_KEY_LOCATION_STANDARD
public KeyboardEvent(@Nonnull
java.lang.String type,
@Nonnull
KeyboardEventInit eventInitDict)
public KeyboardEvent(@Nonnull
java.lang.String type)
@JsProperty(name="altKey") public boolean altKey()
@JsProperty(name="charCode") public int charCode()
@JsProperty(name="code") @Nonnull public java.lang.String code()
@JsProperty(name="ctrlKey") public boolean ctrlKey()
@JsProperty(name="isComposing") public boolean isComposing()
@JsProperty(name="key") @Nonnull public java.lang.String key()
@JsProperty(name="keyCode") public int keyCode()
@JsProperty(name="location") @KeyboardEventLocation public int location()
@JsProperty(name="metaKey") public boolean metaKey()
@JsProperty(name="repeat") public boolean repeat()
@JsProperty(name="shiftKey") public boolean shiftKey()
public boolean getModifierState(@Nonnull
java.lang.String keyArg)