Class KeyboardEvent
java.lang.Object
org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.javascript.HtmlUnitScriptable
org.htmlunit.javascript.host.event.Event
org.htmlunit.javascript.host.event.UIEvent
org.htmlunit.javascript.host.event.KeyboardEvent
- All Implemented Interfaces:
Serializable
,Cloneable
,org.htmlunit.corejs.javascript.ConstProperties
,org.htmlunit.corejs.javascript.debug.DebuggableObject
,org.htmlunit.corejs.javascript.Scriptable
,org.htmlunit.corejs.javascript.SymbolScriptable
JavaScript object representing a Keyboard Event.
For general information on which properties and functions should be supported, see
DOM Level 3 Events.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.corejs.javascript.ScriptableObject.KeyComparator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
The Unicode reference number of the key.private String
The code value of the physical key represented by the event.static final int
Constant forDOM_KEY_LOCATION_LEFT
.static final int
Constant forDOM_KEY_LOCATION_NUMPAD
.static final int
Constant forDOM_KEY_LOCATION_RIGHT
.static final int
Constant forDOM_KEY_LOCATION_STANDARD
.static final int
Constant forDOM_VK_0
.static final int
Constant forDOM_VK_1
.static final int
Constant forDOM_VK_2
.static final int
Constant forDOM_VK_3
.static final int
Constant forDOM_VK_4
.static final int
Constant forDOM_VK_5
.static final int
Constant forDOM_VK_6
.static final int
Constant forDOM_VK_7
.static final int
Constant forDOM_VK_8
.static final int
Constant forDOM_VK_9
.static final int
Constant forDOM_VK_A
.static final int
Constant forDOM_VK_ACCEPT
.static final int
Constant forDOM_VK_ADD
.static final int
Constant forDOM_VK_ALT
.static final int
Constant forDOM_VK_ALTGR
.static final int
Constant forDOM_VK_AMPERSAND
.static final int
Constant forDOM_VK_ASTERISK
.static final int
Constant forDOM_VK_AT
.static final int
Constant forDOM_VK_ATTN
.static final int
Constant forDOM_VK_B
.static final int
Constant forDOM_VK_BACK_QUOTE
.static final int
Constant forDOM_VK_BACK_SLASH
.static final int
Constant forDOM_VK_BACK_SPACE
.static final int
Constant forDOM_VK_C
.static final int
Constant forDOM_VK_CANCEL
.static final int
Constant forDOM_VK_CAPS_LOCK
.static final int
Constant forDOM_VK_CIRCUMFLEX
.static final int
Constant forDOM_VK_CLEAR
.static final int
Constant forDOM_VK_CLOSE_BRACKET
.static final int
Constant forDOM_VK_CLOSE_CURLY_BRACKET
.static final int
Constant forDOM_VK_CLOSE_PAREN
.static final int
Constant forDOM_VK_COLON
.static final int
Constant forDOM_VK_COMMA
.static final int
Constant forDOM_VK_CONTEXT_MENU
.static final int
Constant forDOM_VK_CONTROL
.static final int
Constant forDOM_VK_CONVERT
.static final int
Constant forDOM_VK_CRSEL
.static final int
Constant forDOM_VK_D
.static final int
Constant forDOM_VK_DECIMAL
.static final int
Constant forDOM_VK_DELETE
.static final int
Constant forDOM_VK_DIVIDE
.static final int
Constant forDOM_VK_DOLLAR
.static final int
Constant forDOM_VK_DOUBLE_QUOTE
.static final int
Constant forDOM_VK_DOWN
.static final int
Constant forDOM_VK_E
.static final int
Constant forDOM_VK_EISU
.static final int
Constant forDOM_VK_END
.static final int
Constant forDOM_VK_EQUALS
.static final int
Constant forDOM_VK_EREOF
.static final int
Constant forDOM_VK_ESCAPE
.static final int
Constant forDOM_VK_EXCLAMATION
.static final int
Constant forDOM_VK_EXECUTE
.static final int
Constant forDOM_VK_EXSEL
.static final int
Constant forDOM_VK_F
.static final int
Constant forDOM_VK_F1
.static final int
Constant forDOM_VK_F10
.static final int
Constant forDOM_VK_F11
.static final int
Constant forDOM_VK_F12
.static final int
Constant forDOM_VK_F13
.static final int
Constant forDOM_VK_F14
.static final int
Constant forDOM_VK_F15
.static final int
Constant forDOM_VK_F16
.static final int
Constant forDOM_VK_F17
.static final int
Constant forDOM_VK_F18
.static final int
Constant forDOM_VK_F19
.static final int
Constant forDOM_VK_F2
.static final int
Constant forDOM_VK_F20
.static final int
Constant forDOM_VK_F21
.static final int
Constant forDOM_VK_F22
.static final int
Constant forDOM_VK_F23
.static final int
Constant forDOM_VK_F24
.static final int
Constant forDOM_VK_F3
.static final int
Constant forDOM_VK_F4
.static final int
Constant forDOM_VK_F5
.static final int
Constant forDOM_VK_F6
.static final int
Constant forDOM_VK_F7
.static final int
Constant forDOM_VK_F8
.static final int
Constant forDOM_VK_F9
.static final int
Constant forDOM_VK_FINAL
.static final int
Constant forDOM_VK_G
.static final int
Constant forDOM_VK_GREATER_THAN
.static final int
Constant forDOM_VK_H
.static final int
Constant forDOM_VK_HANGUL
.static final int
Constant forDOM_VK_HANJA
.static final int
Constant forDOM_VK_HASH
.static final int
Constant forDOM_VK_HELP
.static final int
Constant forDOM_VK_HOME
.static final int
Constant forDOM_VK_HYPHEN_MINUS
.static final int
Constant forDOM_VK_I
.static final int
Constant forDOM_VK_INSERT
.static final int
Constant forDOM_VK_J
.static final int
Constant forDOM_VK_JUNJA
.static final int
Constant forDOM_VK_K
.static final int
Constant forDOM_VK_KANA
.static final int
Constant forDOM_VK_KANJI
.static final int
Constant forDOM_VK_L
.static final int
Constant forDOM_VK_LEFT
.static final int
Constant forDOM_VK_LESS_THAN
.static final int
Constant forDOM_VK_M
.static final int
Constant forDOM_VK_META
.static final int
Constant forDOM_VK_MODECHANGE
.static final int
Constant forDOM_VK_MULTIPLY
.static final int
Constant forDOM_VK_N
.static final int
Constant forDOM_VK_NONCONVERT
.static final int
Constant forDOM_VK_NUM_LOCK
.static final int
Constant forDOM_VK_NUMPAD0
.static final int
Constant forDOM_VK_NUMPAD1
.static final int
Constant forDOM_VK_NUMPAD2
.static final int
Constant forDOM_VK_NUMPAD3
.static final int
Constant forDOM_VK_NUMPAD4
.static final int
Constant forDOM_VK_NUMPAD5
.static final int
Constant forDOM_VK_NUMPAD6
.static final int
Constant forDOM_VK_NUMPAD7
.static final int
Constant forDOM_VK_NUMPAD8
.static final int
Constant forDOM_VK_NUMPAD9
.static final int
Constant forDOM_VK_O
.static final int
Constant forDOM_VK_OPEN_BRACKET
.static final int
Constant forDOM_VK_OPEN_CURLY_BRACKET
.static final int
Constant forDOM_VK_OPEN_PAREN
.static final int
Constant forDOM_VK_P
.static final int
Constant forDOM_VK_PA1
.static final int
Constant forDOM_VK_PAGE_DOWN
.static final int
Constant forDOM_VK_PAGE_UP
.static final int
Constant forDOM_VK_PAUSE
.static final int
Constant forDOM_VK_PERCENT
.static final int
Constant forDOM_VK_PERIOD
.static final int
Constant forDOM_VK_PIPE
.static final int
Constant forDOM_VK_PLAY
.static final int
Constant forDOM_VK_PLUS
.static final int
Constant forDOM_VK_PRINT
.static final int
Constant forDOM_VK_PRINTSCREEN
.static final int
Constant forDOM_VK_PROCESSKEY
.static final int
Constant forDOM_VK_Q
.static final int
Constant forDOM_VK_QUESTION_MARK
.static final int
Constant forDOM_VK_QUOTE
.static final int
Constant forDOM_VK_R
.static final int
Constant forDOM_VK_RETURN
.static final int
Constant forDOM_VK_RIGHT
.static final int
Constant forDOM_VK_S
.static final int
Constant forDOM_VK_SCROLL_LOCK
.static final int
Constant forDOM_VK_SELECT
.static final int
Constant forDOM_VK_SEMICOLON
.static final int
Constant forDOM_VK_SEPARATOR
.static final int
Constant forDOM_VK_SHIFT
.static final int
Constant forDOM_VK_SLASH
.static final int
Constant forDOM_VK_SLEEP
.static final int
Constant forDOM_VK_SPACE
.static final int
Constant forDOM_VK_SUBTRACT
.static final int
Constant forDOM_VK_T
.static final int
Constant forDOM_VK_TAB
.static final int
Constant forDOM_VK_TILDE
.static final int
Constant forDOM_VK_U
.static final int
Constant forDOM_VK_UNDERSCORE
.static final int
Constant forDOM_VK_UP
.static final int
Constant forDOM_VK_V
.static final int
Constant forDOM_VK_VOLUME_DOWN
.static final int
Constant forDOM_VK_VOLUME_MUTE
.static final int
Constant forDOM_VK_VOLUME_UP
.static final int
Constant forDOM_VK_W
.static final int
Constant forDOM_VK_WIN
.static final int
Constant forDOM_VK_WIN_ICO_00
.static final int
Constant forDOM_VK_WIN_ICO_CLEAR
.static final int
Constant forDOM_VK_WIN_ICO_HELP
.static final int
Constant forDOM_VK_WIN_OEM_ATTN
.static final int
Constant forDOM_VK_WIN_OEM_AUTO
.static final int
Constant forDOM_VK_WIN_OEM_BACKTAB
.static final int
Constant forDOM_VK_WIN_OEM_CLEAR
.static final int
Constant forDOM_VK_WIN_OEM_COPY
.static final int
Constant forDOM_VK_WIN_OEM_CUSEL
.static final int
Constant forDOM_VK_WIN_OEM_ENLW
.static final int
Constant forDOM_VK_WIN_OEM_FINISH
.static final int
Constant forDOM_VK_WIN_OEM_FJ_JISHO
.static final int
Constant forDOM_VK_WIN_OEM_FJ_LOYA
.static final int
Constant forDOM_VK_WIN_OEM_FJ_MASSHOU
.static final int
Constant forDOM_VK_WIN_OEM_FJ_ROYA
.static final int
Constant forDOM_VK_WIN_OEM_FJ_TOUROKU
.static final int
Constant forDOM_VK_WIN_OEM_JUMP
.static final int
Constant forDOM_VK_WIN_OEM_PA1
.static final int
Constant forDOM_VK_WIN_OEM_PA2
.static final int
Constant forDOM_VK_WIN_OEM_PA3
.static final int
Constant forDOM_VK_WIN_OEM_RESET
.static final int
Constant forDOM_VK_WIN_OEM_WSCTRL
.static final int
Constant forDOM_VK_X
.static final int
Constant forDOM_VK_Y
.static final int
Constant forDOM_VK_Z
.static final int
Constant forDOM_VK_ZOOM
.private boolean
Whether the event is fired after the compositionstart and before the compositionend events.private String
The key value of the key represented by the event.ForEvent.TYPE_KEY_DOWN
andEvent.TYPE_KEY_UP
, this map storesEvent.setKeyCode(int)
associated with the character (if they are not the same).private int
The location of the key on the keyboard or other input device.private boolean
Whether or not the "meta" key was pressed during the firing of the event.private boolean
Whether the key is being held down such that it is automatically repeating.private int
The unmodified value of the pressed key.Fields inherited from class org.htmlunit.javascript.host.event.UIEvent
SCROLL_PAGE_DOWN, SCROLL_PAGE_UP
Fields inherited from class org.htmlunit.javascript.host.event.Event
ALT_MASK, AT_TARGET, BUBBLING_PHASE, CAPTURING_PHASE, CONTROL_MASK, KEY_CURRENT_EVENT, META_MASK, NONE, SHIFT_MASK, TYPE_ABORT, TYPE_AFTERPRINT, TYPE_AFTERSCRIPTEXECUTE, TYPE_ANIMATIONCANCEL, TYPE_ANIMATIONEND, TYPE_ANIMATIONITERATION, TYPE_ANIMATIONSTART, TYPE_AUXCLICK, TYPE_BEFORE_UNLOAD, TYPE_BEFORECOPY, TYPE_BEFORECUT, TYPE_BEFOREPASTE, TYPE_BEFOREPRINT, TYPE_BEFORESCRIPTEXECUTE, TYPE_BLUR, TYPE_CANCEL, TYPE_CANPLAY, TYPE_CANPLAYTHROUGH, TYPE_CHANGE, TYPE_CLOSE, TYPE_COPY, TYPE_CUECHANGE, TYPE_CUT, TYPE_DEVICEMOTION, TYPE_DEVICEORIENTATION, TYPE_DEVICEORIENTATIONABSOLUTE, TYPE_DOM_DOCUMENT_LOADED, TYPE_DRAG, TYPE_DRAGEND, TYPE_DRAGENTER, TYPE_DRAGLEAVE, TYPE_DRAGOVER, TYPE_DRAGSTART, TYPE_DROP, TYPE_DURATIONCHANGE, TYPE_EMPTIED, TYPE_ENDED, TYPE_ERROR, TYPE_FOCUS, TYPE_FOCUS_IN, TYPE_FOCUS_OUT, TYPE_GAMEPAD_CONNECTED, TYPE_GAMEPAD_DISCONNECTED, TYPE_GOTPOINTERCAPTURE, TYPE_HASH_CHANGE, TYPE_INPUT, TYPE_INVALID, TYPE_KEY_DOWN, TYPE_KEY_PRESS, TYPE_KEY_UP, TYPE_LANGUAGECHANGE, TYPE_LOAD, TYPE_LOAD_END, TYPE_LOAD_START, TYPE_LOADEDDATA, TYPE_LOADEDMETADATA, TYPE_LOSTPOINTERCAPTURE, TYPE_MESSAGE, TYPE_MOUDEENTER, TYPE_MOUSELEAVE, TYPE_MOUSEWHEEL, TYPE_MOZFULLSCREENCHANGE, TYPE_MOZFULLSCREENERROR, TYPE_MSSITEMODEJUMPLISTITEMREMOVED, TYPE_OFFLINE, TYPE_ONLINE, TYPE_ONMESSAGEERROR, TYPE_ONTRANSITIONCANCEL, TYPE_ONTRANSITIONEND, TYPE_ONTRANSITIONRUN, TYPE_ONTRANSITIONSTART, TYPE_OPEN, TYPE_PAGEHIDE, TYPE_PAGESHOW, TYPE_PASTE, TYPE_PAUSE, TYPE_PLAY, TYPE_PLAYING, TYPE_POINTERCANCEL, TYPE_POINTERDOWN, TYPE_POINTERENTER, TYPE_POINTERLEAVE, TYPE_POINTERLOCKCHANGE, TYPE_POINTERLOCKERROR, TYPE_POINTERMOVE, TYPE_POINTEROUT, TYPE_POINTEROVER, TYPE_POINTERUP, TYPE_POPSTATE, TYPE_PROGRESS, TYPE_PROPERTY_CHANGE, TYPE_RATECHANGE, TYPE_READY_STATE_CHANGE, TYPE_REJECTIONHANDLED, TYPE_RESET, TYPE_RESIZE, TYPE_SCROLL, TYPE_SCROLLEND, TYPE_SEARCH, TYPE_SEEKED, TYPE_SEEKING, TYPE_SELECT, TYPE_SELECTIONCHANGE, TYPE_SELECTSTART, TYPE_STALLED, TYPE_STORAGE, TYPE_SUBMIT, TYPE_SUSPEND, TYPE_TIMEOUT, TYPE_TIMEUPDATE, TYPE_TOGGLE, TYPE_TRANSITIONEND, TYPE_UNHANDLEDREJECTION, TYPE_UNLOAD, TYPE_VOLUMECHANGE, TYPE_WAITING, TYPE_WEBANIMATIONSTART, TYPE_WEBKITANIMATIONEND, TYPE_WEBKITANIMATIONITERATION, TYPE_WEBKITFULLSCREENCHANGE, TYPE_WEBKITFULLSCREENERROR, TYPE_WEBKITTRANSITIONEND, TYPE_WHEEL
Fields inherited from class org.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
Fields inherited from interface org.htmlunit.corejs.javascript.Scriptable
NOT_FOUND
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new keyboard event instance.KeyboardEvent
(DomNode domNode, String type, char character, boolean shiftKey, boolean ctrlKey, boolean altKey) Creates a new keyboard event instance.KeyboardEvent
(DomNode domNode, String type, int keyCode, boolean shiftKey, boolean ctrlKey, boolean altKey) Creates a new keyboard event instance. -
Method Summary
Modifier and TypeMethodDescriptionprivate static int
charToKeyCode
(char c) Converts a Java character to a keyCode.private String
Determines the value of the 'code' property from the current value of 'keyCode', 'charCode', or 'which'.private String
Determines the value of the 'key' property from the current value of 'keyCode', 'charCode', or 'which'.int
Returns the char code associated with the event.getCode()
Returns a physical key on the keyboard.boolean
Returns whether or not the event is fired after the compositionstart and before the compositionend events.getKey()
Returns the value of a key or keys pressed by the user.int
Returns the key code associated with the event.int
Returns the location of the key on the keyboard.boolean
Returns whether or not the "meta" key was pressed during the event firing.int
getWhich()
Returns the numeric keyCode of the key pressed, or the charCode for an alphanumeric key pressed.void
initKeyboardEvent
(String type, boolean bubbles, boolean cancelable, Object view, String key, int location, boolean ctrlKey, boolean altKey, boolean shiftKey, boolean metaKey) Implementation of the DOM Level 3 Event method for initializing the key event.boolean
isAltKey()
Returns whetherALT
has been pressed during this event or not.private static boolean
isAmbiguousKeyCode
(int keyCode) We can not accept DOM_VK_A, because is it 'A' or 'a', so the character constructor should be used.boolean
Returns whetherCTRL
has been pressed during this event or not.boolean
isRepeat()
Returns whether or not the key is being held down such that it is automatically repeating.boolean
Returns whetherSHIFT
has been pressed during this event or not.static boolean
isShiftNeeded
(char ch, boolean shiftKey) Returns whether the specified character can be written only whenSHIFT
key is pressed.void
jsConstructor
(String type, org.htmlunit.corejs.javascript.ScriptableObject details) JavaScript constructor.protected void
setCharCode
(int charCode) Sets the char code associated with the event.protected void
Sets a physical key on the keyboard.protected void
setIsComposing
(boolean isComposing) Sets whether or not this event is fired after the compositionstart and before the compositionend events.protected void
Sets the value of a key or keys pressed by the user.protected void
setLocation
(int location) Sets the location of the key on the keyboard.protected void
setMetaKey
(boolean metaKey) Sets whether or not the "meta" key was pressed during the event firing.protected void
setRepeat
(boolean repeat) Sets whether or not the key is being held down such that it is automatically repeating.protected void
setWhich
(int which) Sets the numeric keyCode of the key pressed, or the charCode for an alphanumeric key pressed.Methods inherited from class org.htmlunit.javascript.host.event.UIEvent
getDetail, getView, initUIEvent, setDetail
Methods inherited from class org.htmlunit.javascript.host.event.Event
createPropertyChangeEvent, endFire, eventCreated, getComposed, getCurrentTarget, getEventPhase, getPropertyName, getReturnValue, getSrcElement, getTarget, getTimeStamp, getType, handlePropertyHandlerReturnValue, initEvent, isAborted, isBubbles, isCancelable, isCancelBubble, isDefaultPrevented, isImmediatePropagationStopped, isMissingOrUndefined, isPropagationStopped, preventDefault, processLabelAfterBubbling, setAltKey, setBubbles, setCancelable, setCancelBubble, setCtrlKey, setCurrentTarget, setEventPhase, setEventType, setKeyCode, setReturnValue, setShiftKey, setSrcElement, setTarget, setType, startFire, stopImmediatePropagation, stopPropagation, toString
Methods inherited from class org.htmlunit.javascript.HtmlUnitScriptable
clone, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getWindow, getWindow, getWithPreemption, has, hasInstance, initParentScope, makeScriptableFor, put, setClassName, setDomNode, setDomNode, setParentScope, setupPromise, setupRejectedPromise
Methods inherited from class org.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, get, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setPrototype, size
-
Field Details
-
DOM_KEY_LOCATION_STANDARD
public static final int DOM_KEY_LOCATION_STANDARDConstant forDOM_KEY_LOCATION_STANDARD
.- See Also:
-
DOM_KEY_LOCATION_LEFT
public static final int DOM_KEY_LOCATION_LEFTConstant forDOM_KEY_LOCATION_LEFT
.- See Also:
-
DOM_KEY_LOCATION_RIGHT
public static final int DOM_KEY_LOCATION_RIGHTConstant forDOM_KEY_LOCATION_RIGHT
.- See Also:
-
DOM_KEY_LOCATION_NUMPAD
public static final int DOM_KEY_LOCATION_NUMPADConstant forDOM_KEY_LOCATION_NUMPAD
.- See Also:
-
DOM_VK_CANCEL
public static final int DOM_VK_CANCELConstant forDOM_VK_CANCEL
.- See Also:
-
DOM_VK_HELP
public static final int DOM_VK_HELPConstant forDOM_VK_HELP
.- See Also:
-
DOM_VK_TAB
public static final int DOM_VK_TABConstant forDOM_VK_TAB
.- See Also:
-
DOM_VK_CLEAR
public static final int DOM_VK_CLEARConstant forDOM_VK_CLEAR
.- See Also:
-
DOM_VK_RETURN
public static final int DOM_VK_RETURNConstant forDOM_VK_RETURN
.- See Also:
-
DOM_VK_SHIFT
public static final int DOM_VK_SHIFTConstant forDOM_VK_SHIFT
.- See Also:
-
DOM_VK_CONTROL
public static final int DOM_VK_CONTROLConstant forDOM_VK_CONTROL
.- See Also:
-
DOM_VK_ALT
public static final int DOM_VK_ALTConstant forDOM_VK_ALT
.- See Also:
-
DOM_VK_PAUSE
public static final int DOM_VK_PAUSEConstant forDOM_VK_PAUSE
.- See Also:
-
DOM_VK_CAPS_LOCK
public static final int DOM_VK_CAPS_LOCKConstant forDOM_VK_CAPS_LOCK
.- See Also:
-
DOM_VK_HANGUL
public static final int DOM_VK_HANGULConstant forDOM_VK_HANGUL
.- See Also:
-
DOM_VK_KANA
public static final int DOM_VK_KANAConstant forDOM_VK_KANA
.- See Also:
-
DOM_VK_EISU
public static final int DOM_VK_EISUConstant forDOM_VK_EISU
.- See Also:
-
DOM_VK_FINAL
public static final int DOM_VK_FINALConstant forDOM_VK_FINAL
.- See Also:
-
DOM_VK_JUNJA
public static final int DOM_VK_JUNJAConstant forDOM_VK_JUNJA
.- See Also:
-
DOM_VK_HANJA
public static final int DOM_VK_HANJAConstant forDOM_VK_HANJA
.- See Also:
-
DOM_VK_KANJI
public static final int DOM_VK_KANJIConstant forDOM_VK_KANJI
.- See Also:
-
DOM_VK_ESCAPE
public static final int DOM_VK_ESCAPEConstant forDOM_VK_ESCAPE
.- See Also:
-
DOM_VK_CONVERT
public static final int DOM_VK_CONVERTConstant forDOM_VK_CONVERT
.- See Also:
-
DOM_VK_NONCONVERT
public static final int DOM_VK_NONCONVERTConstant forDOM_VK_NONCONVERT
.- See Also:
-
DOM_VK_ACCEPT
public static final int DOM_VK_ACCEPTConstant forDOM_VK_ACCEPT
.- See Also:
-
DOM_VK_MODECHANGE
public static final int DOM_VK_MODECHANGEConstant forDOM_VK_MODECHANGE
.- See Also:
-
DOM_VK_SPACE
public static final int DOM_VK_SPACEConstant forDOM_VK_SPACE
.- See Also:
-
DOM_VK_PAGE_UP
public static final int DOM_VK_PAGE_UPConstant forDOM_VK_PAGE_UP
.- See Also:
-
DOM_VK_PAGE_DOWN
public static final int DOM_VK_PAGE_DOWNConstant forDOM_VK_PAGE_DOWN
.- See Also:
-
DOM_VK_END
public static final int DOM_VK_ENDConstant forDOM_VK_END
.- See Also:
-
DOM_VK_HOME
public static final int DOM_VK_HOMEConstant forDOM_VK_HOME
.- See Also:
-
DOM_VK_LEFT
public static final int DOM_VK_LEFTConstant forDOM_VK_LEFT
.- See Also:
-
DOM_VK_UP
public static final int DOM_VK_UPConstant forDOM_VK_UP
.- See Also:
-
DOM_VK_RIGHT
public static final int DOM_VK_RIGHTConstant forDOM_VK_RIGHT
.- See Also:
-
DOM_VK_SELECT
public static final int DOM_VK_SELECTConstant forDOM_VK_SELECT
.- See Also:
-
DOM_VK_DOWN
public static final int DOM_VK_DOWNConstant forDOM_VK_DOWN
.- See Also:
-
DOM_VK_PRINT
public static final int DOM_VK_PRINTConstant forDOM_VK_PRINT
.- See Also:
-
DOM_VK_EXECUTE
public static final int DOM_VK_EXECUTEConstant forDOM_VK_EXECUTE
.- See Also:
-
DOM_VK_PRINTSCREEN
public static final int DOM_VK_PRINTSCREENConstant forDOM_VK_PRINTSCREEN
.- See Also:
-
DOM_VK_INSERT
public static final int DOM_VK_INSERTConstant forDOM_VK_INSERT
.- See Also:
-
DOM_VK_DELETE
public static final int DOM_VK_DELETEConstant forDOM_VK_DELETE
.- See Also:
-
DOM_VK_0
public static final int DOM_VK_0Constant forDOM_VK_0
.- See Also:
-
DOM_VK_1
public static final int DOM_VK_1Constant forDOM_VK_1
.- See Also:
-
DOM_VK_2
public static final int DOM_VK_2Constant forDOM_VK_2
.- See Also:
-
DOM_VK_3
public static final int DOM_VK_3Constant forDOM_VK_3
.- See Also:
-
DOM_VK_4
public static final int DOM_VK_4Constant forDOM_VK_4
.- See Also:
-
DOM_VK_5
public static final int DOM_VK_5Constant forDOM_VK_5
.- See Also:
-
DOM_VK_6
public static final int DOM_VK_6Constant forDOM_VK_6
.- See Also:
-
DOM_VK_7
public static final int DOM_VK_7Constant forDOM_VK_7
.- See Also:
-
DOM_VK_8
public static final int DOM_VK_8Constant forDOM_VK_8
.- See Also:
-
DOM_VK_9
public static final int DOM_VK_9Constant forDOM_VK_9
.- See Also:
-
DOM_VK_COLON
public static final int DOM_VK_COLONConstant forDOM_VK_COLON
.- See Also:
-
DOM_VK_SEMICOLON
public static final int DOM_VK_SEMICOLONConstant forDOM_VK_SEMICOLON
.- See Also:
-
DOM_VK_LESS_THAN
public static final int DOM_VK_LESS_THANConstant forDOM_VK_LESS_THAN
.- See Also:
-
DOM_VK_EQUALS
public static final int DOM_VK_EQUALSConstant forDOM_VK_EQUALS
.- See Also:
-
DOM_VK_GREATER_THAN
public static final int DOM_VK_GREATER_THANConstant forDOM_VK_GREATER_THAN
.- See Also:
-
DOM_VK_QUESTION_MARK
public static final int DOM_VK_QUESTION_MARKConstant forDOM_VK_QUESTION_MARK
.- See Also:
-
DOM_VK_AT
public static final int DOM_VK_ATConstant forDOM_VK_AT
.- See Also:
-
DOM_VK_A
public static final int DOM_VK_AConstant forDOM_VK_A
.- See Also:
-
DOM_VK_B
public static final int DOM_VK_BConstant forDOM_VK_B
.- See Also:
-
DOM_VK_C
public static final int DOM_VK_CConstant forDOM_VK_C
.- See Also:
-
DOM_VK_D
public static final int DOM_VK_DConstant forDOM_VK_D
.- See Also:
-
DOM_VK_E
public static final int DOM_VK_EConstant forDOM_VK_E
.- See Also:
-
DOM_VK_F
public static final int DOM_VK_FConstant forDOM_VK_F
.- See Also:
-
DOM_VK_G
public static final int DOM_VK_GConstant forDOM_VK_G
.- See Also:
-
DOM_VK_H
public static final int DOM_VK_HConstant forDOM_VK_H
.- See Also:
-
DOM_VK_I
public static final int DOM_VK_IConstant forDOM_VK_I
.- See Also:
-
DOM_VK_J
public static final int DOM_VK_JConstant forDOM_VK_J
.- See Also:
-
DOM_VK_K
public static final int DOM_VK_KConstant forDOM_VK_K
.- See Also:
-
DOM_VK_L
public static final int DOM_VK_LConstant forDOM_VK_L
.- See Also:
-
DOM_VK_M
public static final int DOM_VK_MConstant forDOM_VK_M
.- See Also:
-
DOM_VK_N
public static final int DOM_VK_NConstant forDOM_VK_N
.- See Also:
-
DOM_VK_O
public static final int DOM_VK_OConstant forDOM_VK_O
.- See Also:
-
DOM_VK_BACK_SPACE
public static final int DOM_VK_BACK_SPACEConstant forDOM_VK_BACK_SPACE
.- See Also:
-
DOM_VK_P
public static final int DOM_VK_PConstant forDOM_VK_P
.- See Also:
-
DOM_VK_Q
public static final int DOM_VK_QConstant forDOM_VK_Q
.- See Also:
-
DOM_VK_R
public static final int DOM_VK_RConstant forDOM_VK_R
.- See Also:
-
DOM_VK_S
public static final int DOM_VK_SConstant forDOM_VK_S
.- See Also:
-
DOM_VK_T
public static final int DOM_VK_TConstant forDOM_VK_T
.- See Also:
-
DOM_VK_U
public static final int DOM_VK_UConstant forDOM_VK_U
.- See Also:
-
DOM_VK_V
public static final int DOM_VK_VConstant forDOM_VK_V
.- See Also:
-
DOM_VK_W
public static final int DOM_VK_WConstant forDOM_VK_W
.- See Also:
-
DOM_VK_X
public static final int DOM_VK_XConstant forDOM_VK_X
.- See Also:
-
DOM_VK_Y
public static final int DOM_VK_YConstant forDOM_VK_Y
.- See Also:
-
DOM_VK_Z
public static final int DOM_VK_ZConstant forDOM_VK_Z
.- See Also:
-
DOM_VK_WIN
public static final int DOM_VK_WINConstant forDOM_VK_WIN
.- See Also:
-
DOM_VK_CONTEXT_MENU
public static final int DOM_VK_CONTEXT_MENUConstant forDOM_VK_CONTEXT_MENU
.- See Also:
-
DOM_VK_SLEEP
public static final int DOM_VK_SLEEPConstant forDOM_VK_SLEEP
.- See Also:
-
DOM_VK_NUMPAD0
public static final int DOM_VK_NUMPAD0Constant forDOM_VK_NUMPAD0
.- See Also:
-
DOM_VK_NUMPAD1
public static final int DOM_VK_NUMPAD1Constant forDOM_VK_NUMPAD1
.- See Also:
-
DOM_VK_NUMPAD2
public static final int DOM_VK_NUMPAD2Constant forDOM_VK_NUMPAD2
.- See Also:
-
DOM_VK_NUMPAD3
public static final int DOM_VK_NUMPAD3Constant forDOM_VK_NUMPAD3
.- See Also:
-
DOM_VK_NUMPAD4
public static final int DOM_VK_NUMPAD4Constant forDOM_VK_NUMPAD4
.- See Also:
-
DOM_VK_NUMPAD5
public static final int DOM_VK_NUMPAD5Constant forDOM_VK_NUMPAD5
.- See Also:
-
DOM_VK_NUMPAD6
public static final int DOM_VK_NUMPAD6Constant forDOM_VK_NUMPAD6
.- See Also:
-
DOM_VK_NUMPAD7
public static final int DOM_VK_NUMPAD7Constant forDOM_VK_NUMPAD7
.- See Also:
-
DOM_VK_NUMPAD8
public static final int DOM_VK_NUMPAD8Constant forDOM_VK_NUMPAD8
.- See Also:
-
DOM_VK_NUMPAD9
public static final int DOM_VK_NUMPAD9Constant forDOM_VK_NUMPAD9
.- See Also:
-
DOM_VK_MULTIPLY
public static final int DOM_VK_MULTIPLYConstant forDOM_VK_MULTIPLY
.- See Also:
-
DOM_VK_ADD
public static final int DOM_VK_ADDConstant forDOM_VK_ADD
.- See Also:
-
DOM_VK_SEPARATOR
public static final int DOM_VK_SEPARATORConstant forDOM_VK_SEPARATOR
.- See Also:
-
DOM_VK_SUBTRACT
public static final int DOM_VK_SUBTRACTConstant forDOM_VK_SUBTRACT
.- See Also:
-
DOM_VK_DECIMAL
public static final int DOM_VK_DECIMALConstant forDOM_VK_DECIMAL
.- See Also:
-
DOM_VK_DIVIDE
public static final int DOM_VK_DIVIDEConstant forDOM_VK_DIVIDE
.- See Also:
-
DOM_VK_F1
public static final int DOM_VK_F1Constant forDOM_VK_F1
.- See Also:
-
DOM_VK_F2
public static final int DOM_VK_F2Constant forDOM_VK_F2
.- See Also:
-
DOM_VK_F3
public static final int DOM_VK_F3Constant forDOM_VK_F3
.- See Also:
-
DOM_VK_F4
public static final int DOM_VK_F4Constant forDOM_VK_F4
.- See Also:
-
DOM_VK_F5
public static final int DOM_VK_F5Constant forDOM_VK_F5
.- See Also:
-
DOM_VK_F6
public static final int DOM_VK_F6Constant forDOM_VK_F6
.- See Also:
-
DOM_VK_F7
public static final int DOM_VK_F7Constant forDOM_VK_F7
.- See Also:
-
DOM_VK_F8
public static final int DOM_VK_F8Constant forDOM_VK_F8
.- See Also:
-
DOM_VK_F9
public static final int DOM_VK_F9Constant forDOM_VK_F9
.- See Also:
-
DOM_VK_F10
public static final int DOM_VK_F10Constant forDOM_VK_F10
.- See Also:
-
DOM_VK_F11
public static final int DOM_VK_F11Constant forDOM_VK_F11
.- See Also:
-
DOM_VK_F12
public static final int DOM_VK_F12Constant forDOM_VK_F12
.- See Also:
-
DOM_VK_F13
public static final int DOM_VK_F13Constant forDOM_VK_F13
.- See Also:
-
DOM_VK_F14
public static final int DOM_VK_F14Constant forDOM_VK_F14
.- See Also:
-
DOM_VK_F15
public static final int DOM_VK_F15Constant forDOM_VK_F15
.- See Also:
-
DOM_VK_F16
public static final int DOM_VK_F16Constant forDOM_VK_F16
.- See Also:
-
DOM_VK_F17
public static final int DOM_VK_F17Constant forDOM_VK_F17
.- See Also:
-
DOM_VK_F18
public static final int DOM_VK_F18Constant forDOM_VK_F18
.- See Also:
-
DOM_VK_F19
public static final int DOM_VK_F19Constant forDOM_VK_F19
.- See Also:
-
DOM_VK_F20
public static final int DOM_VK_F20Constant forDOM_VK_F20
.- See Also:
-
DOM_VK_F21
public static final int DOM_VK_F21Constant forDOM_VK_F21
.- See Also:
-
DOM_VK_F22
public static final int DOM_VK_F22Constant forDOM_VK_F22
.- See Also:
-
DOM_VK_F23
public static final int DOM_VK_F23Constant forDOM_VK_F23
.- See Also:
-
DOM_VK_F24
public static final int DOM_VK_F24Constant forDOM_VK_F24
.- See Also:
-
DOM_VK_NUM_LOCK
public static final int DOM_VK_NUM_LOCKConstant forDOM_VK_NUM_LOCK
.- See Also:
-
DOM_VK_SCROLL_LOCK
public static final int DOM_VK_SCROLL_LOCKConstant forDOM_VK_SCROLL_LOCK
.- See Also:
-
DOM_VK_WIN_OEM_FJ_JISHO
public static final int DOM_VK_WIN_OEM_FJ_JISHOConstant forDOM_VK_WIN_OEM_FJ_JISHO
.- See Also:
-
DOM_VK_WIN_OEM_FJ_MASSHOU
public static final int DOM_VK_WIN_OEM_FJ_MASSHOUConstant forDOM_VK_WIN_OEM_FJ_MASSHOU
.- See Also:
-
DOM_VK_WIN_OEM_FJ_TOUROKU
public static final int DOM_VK_WIN_OEM_FJ_TOUROKUConstant forDOM_VK_WIN_OEM_FJ_TOUROKU
.- See Also:
-
DOM_VK_WIN_OEM_FJ_LOYA
public static final int DOM_VK_WIN_OEM_FJ_LOYAConstant forDOM_VK_WIN_OEM_FJ_LOYA
.- See Also:
-
DOM_VK_WIN_OEM_FJ_ROYA
public static final int DOM_VK_WIN_OEM_FJ_ROYAConstant forDOM_VK_WIN_OEM_FJ_ROYA
.- See Also:
-
DOM_VK_CIRCUMFLEX
public static final int DOM_VK_CIRCUMFLEXConstant forDOM_VK_CIRCUMFLEX
.- See Also:
-
DOM_VK_EXCLAMATION
public static final int DOM_VK_EXCLAMATIONConstant forDOM_VK_EXCLAMATION
.- See Also:
-
DOM_VK_DOUBLE_QUOTE
public static final int DOM_VK_DOUBLE_QUOTEConstant forDOM_VK_DOUBLE_QUOTE
.- See Also:
-
DOM_VK_HASH
public static final int DOM_VK_HASHConstant forDOM_VK_HASH
.- See Also:
-
DOM_VK_DOLLAR
public static final int DOM_VK_DOLLARConstant forDOM_VK_DOLLAR
.- See Also:
-
DOM_VK_PERCENT
public static final int DOM_VK_PERCENTConstant forDOM_VK_PERCENT
.- See Also:
-
DOM_VK_AMPERSAND
public static final int DOM_VK_AMPERSANDConstant forDOM_VK_AMPERSAND
.- See Also:
-
DOM_VK_UNDERSCORE
public static final int DOM_VK_UNDERSCOREConstant forDOM_VK_UNDERSCORE
.- See Also:
-
DOM_VK_OPEN_PAREN
public static final int DOM_VK_OPEN_PARENConstant forDOM_VK_OPEN_PAREN
.- See Also:
-
DOM_VK_CLOSE_PAREN
public static final int DOM_VK_CLOSE_PARENConstant forDOM_VK_CLOSE_PAREN
.- See Also:
-
DOM_VK_ASTERISK
public static final int DOM_VK_ASTERISKConstant forDOM_VK_ASTERISK
.- See Also:
-
DOM_VK_PLUS
public static final int DOM_VK_PLUSConstant forDOM_VK_PLUS
.- See Also:
-
DOM_VK_PIPE
public static final int DOM_VK_PIPEConstant forDOM_VK_PIPE
.- See Also:
-
DOM_VK_HYPHEN_MINUS
public static final int DOM_VK_HYPHEN_MINUSConstant forDOM_VK_HYPHEN_MINUS
.- See Also:
-
DOM_VK_OPEN_CURLY_BRACKET
public static final int DOM_VK_OPEN_CURLY_BRACKETConstant forDOM_VK_OPEN_CURLY_BRACKET
.- See Also:
-
DOM_VK_CLOSE_CURLY_BRACKET
public static final int DOM_VK_CLOSE_CURLY_BRACKETConstant forDOM_VK_CLOSE_CURLY_BRACKET
.- See Also:
-
DOM_VK_TILDE
public static final int DOM_VK_TILDEConstant forDOM_VK_TILDE
.- See Also:
-
DOM_VK_VOLUME_MUTE
public static final int DOM_VK_VOLUME_MUTEConstant forDOM_VK_VOLUME_MUTE
.- See Also:
-
DOM_VK_VOLUME_DOWN
public static final int DOM_VK_VOLUME_DOWNConstant forDOM_VK_VOLUME_DOWN
.- See Also:
-
DOM_VK_VOLUME_UP
public static final int DOM_VK_VOLUME_UPConstant forDOM_VK_VOLUME_UP
.- See Also:
-
DOM_VK_COMMA
public static final int DOM_VK_COMMAConstant forDOM_VK_COMMA
.- See Also:
-
DOM_VK_PERIOD
public static final int DOM_VK_PERIODConstant forDOM_VK_PERIOD
.- See Also:
-
DOM_VK_SLASH
public static final int DOM_VK_SLASHConstant forDOM_VK_SLASH
.- See Also:
-
DOM_VK_BACK_QUOTE
public static final int DOM_VK_BACK_QUOTEConstant forDOM_VK_BACK_QUOTE
.- See Also:
-
DOM_VK_OPEN_BRACKET
public static final int DOM_VK_OPEN_BRACKETConstant forDOM_VK_OPEN_BRACKET
.- See Also:
-
DOM_VK_BACK_SLASH
public static final int DOM_VK_BACK_SLASHConstant forDOM_VK_BACK_SLASH
.- See Also:
-
DOM_VK_CLOSE_BRACKET
public static final int DOM_VK_CLOSE_BRACKETConstant forDOM_VK_CLOSE_BRACKET
.- See Also:
-
DOM_VK_QUOTE
public static final int DOM_VK_QUOTEConstant forDOM_VK_QUOTE
.- See Also:
-
DOM_VK_META
public static final int DOM_VK_METAConstant forDOM_VK_META
.- See Also:
-
DOM_VK_ALTGR
public static final int DOM_VK_ALTGRConstant forDOM_VK_ALTGR
.- See Also:
-
DOM_VK_WIN_ICO_HELP
public static final int DOM_VK_WIN_ICO_HELPConstant forDOM_VK_WIN_ICO_HELP
.- See Also:
-
DOM_VK_WIN_ICO_00
public static final int DOM_VK_WIN_ICO_00Constant forDOM_VK_WIN_ICO_00
.- See Also:
-
DOM_VK_PROCESSKEY
public static final int DOM_VK_PROCESSKEYConstant forDOM_VK_PROCESSKEY
.- See Also:
-
DOM_VK_WIN_ICO_CLEAR
public static final int DOM_VK_WIN_ICO_CLEARConstant forDOM_VK_WIN_ICO_CLEAR
.- See Also:
-
DOM_VK_WIN_OEM_RESET
public static final int DOM_VK_WIN_OEM_RESETConstant forDOM_VK_WIN_OEM_RESET
.- See Also:
-
DOM_VK_WIN_OEM_JUMP
public static final int DOM_VK_WIN_OEM_JUMPConstant forDOM_VK_WIN_OEM_JUMP
.- See Also:
-
DOM_VK_WIN_OEM_PA1
public static final int DOM_VK_WIN_OEM_PA1Constant forDOM_VK_WIN_OEM_PA1
.- See Also:
-
DOM_VK_WIN_OEM_PA2
public static final int DOM_VK_WIN_OEM_PA2Constant forDOM_VK_WIN_OEM_PA2
.- See Also:
-
DOM_VK_WIN_OEM_PA3
public static final int DOM_VK_WIN_OEM_PA3Constant forDOM_VK_WIN_OEM_PA3
.- See Also:
-
DOM_VK_WIN_OEM_WSCTRL
public static final int DOM_VK_WIN_OEM_WSCTRLConstant forDOM_VK_WIN_OEM_WSCTRL
.- See Also:
-
DOM_VK_WIN_OEM_CUSEL
public static final int DOM_VK_WIN_OEM_CUSELConstant forDOM_VK_WIN_OEM_CUSEL
.- See Also:
-
DOM_VK_WIN_OEM_ATTN
public static final int DOM_VK_WIN_OEM_ATTNConstant forDOM_VK_WIN_OEM_ATTN
.- See Also:
-
DOM_VK_WIN_OEM_FINISH
public static final int DOM_VK_WIN_OEM_FINISHConstant forDOM_VK_WIN_OEM_FINISH
.- See Also:
-
DOM_VK_WIN_OEM_COPY
public static final int DOM_VK_WIN_OEM_COPYConstant forDOM_VK_WIN_OEM_COPY
.- See Also:
-
DOM_VK_WIN_OEM_AUTO
public static final int DOM_VK_WIN_OEM_AUTOConstant forDOM_VK_WIN_OEM_AUTO
.- See Also:
-
DOM_VK_WIN_OEM_ENLW
public static final int DOM_VK_WIN_OEM_ENLWConstant forDOM_VK_WIN_OEM_ENLW
.- See Also:
-
DOM_VK_WIN_OEM_BACKTAB
public static final int DOM_VK_WIN_OEM_BACKTABConstant forDOM_VK_WIN_OEM_BACKTAB
.- See Also:
-
DOM_VK_ATTN
public static final int DOM_VK_ATTNConstant forDOM_VK_ATTN
.- See Also:
-
DOM_VK_CRSEL
public static final int DOM_VK_CRSELConstant forDOM_VK_CRSEL
.- See Also:
-
DOM_VK_EXSEL
public static final int DOM_VK_EXSELConstant forDOM_VK_EXSEL
.- See Also:
-
DOM_VK_EREOF
public static final int DOM_VK_EREOFConstant forDOM_VK_EREOF
.- See Also:
-
DOM_VK_PLAY
public static final int DOM_VK_PLAYConstant forDOM_VK_PLAY
.- See Also:
-
DOM_VK_ZOOM
public static final int DOM_VK_ZOOMConstant forDOM_VK_ZOOM
.- See Also:
-
DOM_VK_PA1
public static final int DOM_VK_PA1Constant forDOM_VK_PA1
.- See Also:
-
DOM_VK_WIN_OEM_CLEAR
public static final int DOM_VK_WIN_OEM_CLEARConstant forDOM_VK_WIN_OEM_CLEAR
.- See Also:
-
keyCodeMap
ForEvent.TYPE_KEY_DOWN
andEvent.TYPE_KEY_UP
, this map storesEvent.setKeyCode(int)
associated with the character (if they are not the same). You can verify this here -
key_
The key value of the key represented by the event. -
code_
The code value of the physical key represented by the event. -
location_
private int location_The location of the key on the keyboard or other input device. See DOM_KEY_LOCATION_* constants. -
metaKey_
private boolean metaKey_Whether or not the "meta" key was pressed during the firing of the event. -
repeat_
private boolean repeat_Whether the key is being held down such that it is automatically repeating. -
isComposing_
private boolean isComposing_Whether the event is fired after the compositionstart and before the compositionend events. -
charCode_
private int charCode_The Unicode reference number of the key. -
which_
private int which_The unmodified value of the pressed key. This is usually the same as keyCode.
-
-
Constructor Details
-
KeyboardEvent
public KeyboardEvent()Creates a new keyboard event instance. -
KeyboardEvent
public KeyboardEvent(DomNode domNode, String type, char character, boolean shiftKey, boolean ctrlKey, boolean altKey) Creates a new keyboard event instance.- Parameters:
domNode
- the DOM node that triggered the eventtype
- the event typecharacter
- the character associated with the eventshiftKey
- true if SHIFT is pressedctrlKey
- true if CTRL is pressedaltKey
- true if ALT is pressed
-
KeyboardEvent
public KeyboardEvent(DomNode domNode, String type, int keyCode, boolean shiftKey, boolean ctrlKey, boolean altKey) Creates a new keyboard event instance.- Parameters:
domNode
- the DOM node that triggered the eventtype
- the event typekeyCode
- the key code associated with the eventshiftKey
- true if SHIFT is pressedctrlKey
- true if CTRL is pressedaltKey
- true if ALT is pressed
-
-
Method Details
-
isShiftNeeded
public static boolean isShiftNeeded(char ch, boolean shiftKey) Returns whether the specified character can be written only whenSHIFT
key is pressed.- Parameters:
ch
- the charactershiftKey
- is shift key pressed- Returns:
- whether the specified character can be written only when
SHIFT
key is pressed
-
isAmbiguousKeyCode
private static boolean isAmbiguousKeyCode(int keyCode) We can not accept DOM_VK_A, because is it 'A' or 'a', so the character constructor should be used. -
charToKeyCode
private static int charToKeyCode(char c) Converts a Java character to a keyCode.- Parameters:
c
- the character- Returns:
- the corresponding keycode
- See Also:
-
determineKey
Determines the value of the 'key' property from the current value of 'keyCode', 'charCode', or 'which'.- Returns:
- the key value
-
determineCode
Determines the value of the 'code' property from the current value of 'keyCode', 'charCode', or 'which'.- Returns:
- the code value
-
jsConstructor
JavaScript constructor.- Overrides:
jsConstructor
in classUIEvent
- Parameters:
type
- the event typedetails
- the event details (optional)
-
initKeyboardEvent
public void initKeyboardEvent(String type, boolean bubbles, boolean cancelable, Object view, String key, int location, boolean ctrlKey, boolean altKey, boolean shiftKey, boolean metaKey) Implementation of the DOM Level 3 Event method for initializing the key event.- Parameters:
type
- the event typebubbles
- can the event bubblecancelable
- can the event be canceledview
- the view to use for this eventkey
- the value of the key attribute. Defaults to ""location
- the value of the location attribute. Defaults to 0ctrlKey
- is the control key pressedaltKey
- is the alt key pressedshiftKey
- is the shift key pressedmetaKey
- is the meta key pressed
-
getCharCode
public int getCharCode()Returns the char code associated with the event.- Returns:
- the char code associated with the event
-
setCharCode
protected void setCharCode(int charCode) Sets the char code associated with the event.- Parameters:
charCode
- the char code associated with the event
-
getWhich
public int getWhich()Returns the numeric keyCode of the key pressed, or the charCode for an alphanumeric key pressed. -
setWhich
protected void setWhich(int which) Sets the numeric keyCode of the key pressed, or the charCode for an alphanumeric key pressed.- Parameters:
which
- the numeric keyCode of the key pressed, or the charCode for an alphanumeric key pressed
-
getKeyCode
public int getKeyCode()Returns the key code associated with the event. Overridden to modify browser configurations.- Overrides:
getKeyCode
in classEvent
- Returns:
- the key code associated with the event
-
isShiftKey
public boolean isShiftKey()Returns whetherSHIFT
has been pressed during this event or not.- Overrides:
isShiftKey
in classEvent
- Returns:
- whether
SHIFT
has been pressed during this event or not
-
isCtrlKey
public boolean isCtrlKey()Returns whetherCTRL
has been pressed during this event or not. -
isAltKey
public boolean isAltKey()Returns whetherALT
has been pressed during this event or not. -
getKey
Returns the value of a key or keys pressed by the user.- Returns:
- the value of a key or keys pressed by the user
-
setKey
Sets the value of a key or keys pressed by the user.- Parameters:
key
- the value of a key or keys pressed by the user
-
getCode
Returns a physical key on the keyboard.- Returns:
- a physical key on the keyboard
-
setCode
Sets a physical key on the keyboard.- Parameters:
code
- a physical key on the keyboard
-
getMetaKey
public boolean getMetaKey()Returns whether or not the "meta" key was pressed during the event firing.- Returns:
- whether or not the "meta" key was pressed during the event firing
-
setMetaKey
protected void setMetaKey(boolean metaKey) Sets whether or not the "meta" key was pressed during the event firing.- Parameters:
metaKey
- whether or not the "meta" was pressed during the event firing
-
getLocation
public int getLocation()Returns the location of the key on the keyboard.- Returns:
- the location of the key on the keyboard
-
setLocation
protected void setLocation(int location) Sets the location of the key on the keyboard.- Parameters:
location
- the location of the key on the keyboard
-
isRepeat
public boolean isRepeat()Returns whether or not the key is being held down such that it is automatically repeating.- Returns:
- whether or not the key is being held down
-
setRepeat
protected void setRepeat(boolean repeat) Sets whether or not the key is being held down such that it is automatically repeating.- Parameters:
repeat
- whether or not the key is being held down
-
getIsComposing
public boolean getIsComposing()Returns whether or not the event is fired after the compositionstart and before the compositionend events.- Returns:
- whether or not the event is fired while composing
-
setIsComposing
protected void setIsComposing(boolean isComposing) Sets whether or not this event is fired after the compositionstart and before the compositionend events.- Parameters:
isComposing
- whether or not this event is fired while composing
-