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:
java.io.Serializable
,java.lang.Cloneable
,org.htmlunit.corejs.javascript.ConstProperties
,org.htmlunit.corejs.javascript.debug.DebuggableObject
,org.htmlunit.corejs.javascript.Scriptable
,org.htmlunit.corejs.javascript.SymbolScriptable
public class KeyboardEvent extends UIEvent
JavaScript object representing a Keyboard Event. For general information on which properties and functions should be supported, see DOM Level 3 Events.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private int
charCode_
The Unicode reference number of the key.private java.lang.String
code_
The code value of the physical key represented by the event.static int
DOM_KEY_LOCATION_LEFT
Constant forDOM_KEY_LOCATION_LEFT
.static int
DOM_KEY_LOCATION_NUMPAD
Constant forDOM_KEY_LOCATION_NUMPAD
.static int
DOM_KEY_LOCATION_RIGHT
Constant forDOM_KEY_LOCATION_RIGHT
.static int
DOM_KEY_LOCATION_STANDARD
Constant forDOM_KEY_LOCATION_STANDARD
.static int
DOM_VK_0
Constant forDOM_VK_0
.static int
DOM_VK_1
Constant forDOM_VK_1
.static int
DOM_VK_2
Constant forDOM_VK_2
.static int
DOM_VK_3
Constant forDOM_VK_3
.static int
DOM_VK_4
Constant forDOM_VK_4
.static int
DOM_VK_5
Constant forDOM_VK_5
.static int
DOM_VK_6
Constant forDOM_VK_6
.static int
DOM_VK_7
Constant forDOM_VK_7
.static int
DOM_VK_8
Constant forDOM_VK_8
.static int
DOM_VK_9
Constant forDOM_VK_9
.static int
DOM_VK_A
Constant forDOM_VK_A
.static int
DOM_VK_ACCEPT
Constant forDOM_VK_ACCEPT
.static int
DOM_VK_ADD
Constant forDOM_VK_ADD
.static int
DOM_VK_ALT
Constant forDOM_VK_ALT
.static int
DOM_VK_ALTGR
Constant forDOM_VK_ALTGR
.static int
DOM_VK_AMPERSAND
Constant forDOM_VK_AMPERSAND
.static int
DOM_VK_ASTERISK
Constant forDOM_VK_ASTERISK
.static int
DOM_VK_AT
Constant forDOM_VK_AT
.static int
DOM_VK_ATTN
Constant forDOM_VK_ATTN
.static int
DOM_VK_B
Constant forDOM_VK_B
.static int
DOM_VK_BACK_QUOTE
Constant forDOM_VK_BACK_QUOTE
.static int
DOM_VK_BACK_SLASH
Constant forDOM_VK_BACK_SLASH
.static int
DOM_VK_BACK_SPACE
Constant forDOM_VK_BACK_SPACE
.static int
DOM_VK_C
Constant forDOM_VK_C
.static int
DOM_VK_CANCEL
Constant forDOM_VK_CANCEL
.static int
DOM_VK_CAPS_LOCK
Constant forDOM_VK_CAPS_LOCK
.static int
DOM_VK_CIRCUMFLEX
Constant forDOM_VK_CIRCUMFLEX
.static int
DOM_VK_CLEAR
Constant forDOM_VK_CLEAR
.static int
DOM_VK_CLOSE_BRACKET
Constant forDOM_VK_CLOSE_BRACKET
.static int
DOM_VK_CLOSE_CURLY_BRACKET
Constant forDOM_VK_CLOSE_CURLY_BRACKET
.static int
DOM_VK_CLOSE_PAREN
Constant forDOM_VK_CLOSE_PAREN
.static int
DOM_VK_COLON
Constant forDOM_VK_COLON
.static int
DOM_VK_COMMA
Constant forDOM_VK_COMMA
.static int
DOM_VK_CONTEXT_MENU
Constant forDOM_VK_CONTEXT_MENU
.static int
DOM_VK_CONTROL
Constant forDOM_VK_CONTROL
.static int
DOM_VK_CONVERT
Constant forDOM_VK_CONVERT
.static int
DOM_VK_CRSEL
Constant forDOM_VK_CRSEL
.static int
DOM_VK_D
Constant forDOM_VK_D
.static int
DOM_VK_DECIMAL
Constant forDOM_VK_DECIMAL
.static int
DOM_VK_DELETE
Constant forDOM_VK_DELETE
.static int
DOM_VK_DIVIDE
Constant forDOM_VK_DIVIDE
.static int
DOM_VK_DOLLAR
Constant forDOM_VK_DOLLAR
.static int
DOM_VK_DOUBLE_QUOTE
Constant forDOM_VK_DOUBLE_QUOTE
.static int
DOM_VK_DOWN
Constant forDOM_VK_DOWN
.static int
DOM_VK_E
Constant forDOM_VK_E
.static int
DOM_VK_EISU
Constant forDOM_VK_EISU
.static int
DOM_VK_END
Constant forDOM_VK_END
.static int
DOM_VK_EQUALS
Constant forDOM_VK_EQUALS
.static int
DOM_VK_EREOF
Constant forDOM_VK_EREOF
.static int
DOM_VK_ESCAPE
Constant forDOM_VK_ESCAPE
.static int
DOM_VK_EXCLAMATION
Constant forDOM_VK_EXCLAMATION
.static int
DOM_VK_EXECUTE
Constant forDOM_VK_EXECUTE
.static int
DOM_VK_EXSEL
Constant forDOM_VK_EXSEL
.static int
DOM_VK_F
Constant forDOM_VK_F
.static int
DOM_VK_F1
Constant forDOM_VK_F1
.static int
DOM_VK_F10
Constant forDOM_VK_F10
.static int
DOM_VK_F11
Constant forDOM_VK_F11
.static int
DOM_VK_F12
Constant forDOM_VK_F12
.static int
DOM_VK_F13
Constant forDOM_VK_F13
.static int
DOM_VK_F14
Constant forDOM_VK_F14
.static int
DOM_VK_F15
Constant forDOM_VK_F15
.static int
DOM_VK_F16
Constant forDOM_VK_F16
.static int
DOM_VK_F17
Constant forDOM_VK_F17
.static int
DOM_VK_F18
Constant forDOM_VK_F18
.static int
DOM_VK_F19
Constant forDOM_VK_F19
.static int
DOM_VK_F2
Constant forDOM_VK_F2
.static int
DOM_VK_F20
Constant forDOM_VK_F20
.static int
DOM_VK_F21
Constant forDOM_VK_F21
.static int
DOM_VK_F22
Constant forDOM_VK_F22
.static int
DOM_VK_F23
Constant forDOM_VK_F23
.static int
DOM_VK_F24
Constant forDOM_VK_F24
.static int
DOM_VK_F3
Constant forDOM_VK_F3
.static int
DOM_VK_F4
Constant forDOM_VK_F4
.static int
DOM_VK_F5
Constant forDOM_VK_F5
.static int
DOM_VK_F6
Constant forDOM_VK_F6
.static int
DOM_VK_F7
Constant forDOM_VK_F7
.static int
DOM_VK_F8
Constant forDOM_VK_F8
.static int
DOM_VK_F9
Constant forDOM_VK_F9
.static int
DOM_VK_FINAL
Constant forDOM_VK_FINAL
.static int
DOM_VK_G
Constant forDOM_VK_G
.static int
DOM_VK_GREATER_THAN
Constant forDOM_VK_GREATER_THAN
.static int
DOM_VK_H
Constant forDOM_VK_H
.static int
DOM_VK_HANGUL
Constant forDOM_VK_HANGUL
.static int
DOM_VK_HANJA
Constant forDOM_VK_HANJA
.static int
DOM_VK_HASH
Constant forDOM_VK_HASH
.static int
DOM_VK_HELP
Constant forDOM_VK_HELP
.static int
DOM_VK_HOME
Constant forDOM_VK_HOME
.static int
DOM_VK_HYPHEN_MINUS
Constant forDOM_VK_HYPHEN_MINUS
.static int
DOM_VK_I
Constant forDOM_VK_I
.static int
DOM_VK_INSERT
Constant forDOM_VK_INSERT
.static int
DOM_VK_J
Constant forDOM_VK_J
.static int
DOM_VK_JUNJA
Constant forDOM_VK_JUNJA
.static int
DOM_VK_K
Constant forDOM_VK_K
.static int
DOM_VK_KANA
Constant forDOM_VK_KANA
.static int
DOM_VK_KANJI
Constant forDOM_VK_KANJI
.static int
DOM_VK_L
Constant forDOM_VK_L
.static int
DOM_VK_LEFT
Constant forDOM_VK_LEFT
.static int
DOM_VK_LESS_THAN
Constant forDOM_VK_LESS_THAN
.static int
DOM_VK_M
Constant forDOM_VK_M
.static int
DOM_VK_META
Constant forDOM_VK_META
.static int
DOM_VK_MODECHANGE
Constant forDOM_VK_MODECHANGE
.static int
DOM_VK_MULTIPLY
Constant forDOM_VK_MULTIPLY
.static int
DOM_VK_N
Constant forDOM_VK_N
.static int
DOM_VK_NONCONVERT
Constant forDOM_VK_NONCONVERT
.static int
DOM_VK_NUM_LOCK
Constant forDOM_VK_NUM_LOCK
.static int
DOM_VK_NUMPAD0
Constant forDOM_VK_NUMPAD0
.static int
DOM_VK_NUMPAD1
Constant forDOM_VK_NUMPAD1
.static int
DOM_VK_NUMPAD2
Constant forDOM_VK_NUMPAD2
.static int
DOM_VK_NUMPAD3
Constant forDOM_VK_NUMPAD3
.static int
DOM_VK_NUMPAD4
Constant forDOM_VK_NUMPAD4
.static int
DOM_VK_NUMPAD5
Constant forDOM_VK_NUMPAD5
.static int
DOM_VK_NUMPAD6
Constant forDOM_VK_NUMPAD6
.static int
DOM_VK_NUMPAD7
Constant forDOM_VK_NUMPAD7
.static int
DOM_VK_NUMPAD8
Constant forDOM_VK_NUMPAD8
.static int
DOM_VK_NUMPAD9
Constant forDOM_VK_NUMPAD9
.static int
DOM_VK_O
Constant forDOM_VK_O
.static int
DOM_VK_OPEN_BRACKET
Constant forDOM_VK_OPEN_BRACKET
.static int
DOM_VK_OPEN_CURLY_BRACKET
Constant forDOM_VK_OPEN_CURLY_BRACKET
.static int
DOM_VK_OPEN_PAREN
Constant forDOM_VK_OPEN_PAREN
.static int
DOM_VK_P
Constant forDOM_VK_P
.static int
DOM_VK_PA1
Constant forDOM_VK_PA1
.static int
DOM_VK_PAGE_DOWN
Constant forDOM_VK_PAGE_DOWN
.static int
DOM_VK_PAGE_UP
Constant forDOM_VK_PAGE_UP
.static int
DOM_VK_PAUSE
Constant forDOM_VK_PAUSE
.static int
DOM_VK_PERCENT
Constant forDOM_VK_PERCENT
.static int
DOM_VK_PERIOD
Constant forDOM_VK_PERIOD
.static int
DOM_VK_PIPE
Constant forDOM_VK_PIPE
.static int
DOM_VK_PLAY
Constant forDOM_VK_PLAY
.static int
DOM_VK_PLUS
Constant forDOM_VK_PLUS
.static int
DOM_VK_PRINT
Constant forDOM_VK_PRINT
.static int
DOM_VK_PRINTSCREEN
Constant forDOM_VK_PRINTSCREEN
.static int
DOM_VK_PROCESSKEY
Constant forDOM_VK_PROCESSKEY
.static int
DOM_VK_Q
Constant forDOM_VK_Q
.static int
DOM_VK_QUESTION_MARK
Constant forDOM_VK_QUESTION_MARK
.static int
DOM_VK_QUOTE
Constant forDOM_VK_QUOTE
.static int
DOM_VK_R
Constant forDOM_VK_R
.static int
DOM_VK_RETURN
Constant forDOM_VK_RETURN
.static int
DOM_VK_RIGHT
Constant forDOM_VK_RIGHT
.static int
DOM_VK_S
Constant forDOM_VK_S
.static int
DOM_VK_SCROLL_LOCK
Constant forDOM_VK_SCROLL_LOCK
.static int
DOM_VK_SELECT
Constant forDOM_VK_SELECT
.static int
DOM_VK_SEMICOLON
Constant forDOM_VK_SEMICOLON
.static int
DOM_VK_SEPARATOR
Constant forDOM_VK_SEPARATOR
.static int
DOM_VK_SHIFT
Constant forDOM_VK_SHIFT
.static int
DOM_VK_SLASH
Constant forDOM_VK_SLASH
.static int
DOM_VK_SLEEP
Constant forDOM_VK_SLEEP
.static int
DOM_VK_SPACE
Constant forDOM_VK_SPACE
.static int
DOM_VK_SUBTRACT
Constant forDOM_VK_SUBTRACT
.static int
DOM_VK_T
Constant forDOM_VK_T
.static int
DOM_VK_TAB
Constant forDOM_VK_TAB
.static int
DOM_VK_TILDE
Constant forDOM_VK_TILDE
.static int
DOM_VK_U
Constant forDOM_VK_U
.static int
DOM_VK_UNDERSCORE
Constant forDOM_VK_UNDERSCORE
.static int
DOM_VK_UP
Constant forDOM_VK_UP
.static int
DOM_VK_V
Constant forDOM_VK_V
.static int
DOM_VK_VOLUME_DOWN
Constant forDOM_VK_VOLUME_DOWN
.static int
DOM_VK_VOLUME_MUTE
Constant forDOM_VK_VOLUME_MUTE
.static int
DOM_VK_VOLUME_UP
Constant forDOM_VK_VOLUME_UP
.static int
DOM_VK_W
Constant forDOM_VK_W
.static int
DOM_VK_WIN
Constant forDOM_VK_WIN
.static int
DOM_VK_WIN_ICO_00
Constant forDOM_VK_WIN_ICO_00
.static int
DOM_VK_WIN_ICO_CLEAR
Constant forDOM_VK_WIN_ICO_CLEAR
.static int
DOM_VK_WIN_ICO_HELP
Constant forDOM_VK_WIN_ICO_HELP
.static int
DOM_VK_WIN_OEM_ATTN
Constant forDOM_VK_WIN_OEM_ATTN
.static int
DOM_VK_WIN_OEM_AUTO
Constant forDOM_VK_WIN_OEM_AUTO
.static int
DOM_VK_WIN_OEM_BACKTAB
Constant forDOM_VK_WIN_OEM_BACKTAB
.static int
DOM_VK_WIN_OEM_CLEAR
Constant forDOM_VK_WIN_OEM_CLEAR
.static int
DOM_VK_WIN_OEM_COPY
Constant forDOM_VK_WIN_OEM_COPY
.static int
DOM_VK_WIN_OEM_CUSEL
Constant forDOM_VK_WIN_OEM_CUSEL
.static int
DOM_VK_WIN_OEM_ENLW
Constant forDOM_VK_WIN_OEM_ENLW
.static int
DOM_VK_WIN_OEM_FINISH
Constant forDOM_VK_WIN_OEM_FINISH
.static int
DOM_VK_WIN_OEM_FJ_JISHO
Constant forDOM_VK_WIN_OEM_FJ_JISHO
.static int
DOM_VK_WIN_OEM_FJ_LOYA
Constant forDOM_VK_WIN_OEM_FJ_LOYA
.static int
DOM_VK_WIN_OEM_FJ_MASSHOU
Constant forDOM_VK_WIN_OEM_FJ_MASSHOU
.static int
DOM_VK_WIN_OEM_FJ_ROYA
Constant forDOM_VK_WIN_OEM_FJ_ROYA
.static int
DOM_VK_WIN_OEM_FJ_TOUROKU
Constant forDOM_VK_WIN_OEM_FJ_TOUROKU
.static int
DOM_VK_WIN_OEM_JUMP
Constant forDOM_VK_WIN_OEM_JUMP
.static int
DOM_VK_WIN_OEM_PA1
Constant forDOM_VK_WIN_OEM_PA1
.static int
DOM_VK_WIN_OEM_PA2
Constant forDOM_VK_WIN_OEM_PA2
.static int
DOM_VK_WIN_OEM_PA3
Constant forDOM_VK_WIN_OEM_PA3
.static int
DOM_VK_WIN_OEM_RESET
Constant forDOM_VK_WIN_OEM_RESET
.static int
DOM_VK_WIN_OEM_WSCTRL
Constant forDOM_VK_WIN_OEM_WSCTRL
.static int
DOM_VK_X
Constant forDOM_VK_X
.static int
DOM_VK_Y
Constant forDOM_VK_Y
.static int
DOM_VK_Z
Constant forDOM_VK_Z
.static int
DOM_VK_ZOOM
Constant forDOM_VK_ZOOM
.private boolean
isComposing_
Whether the event is fired after the compositionstart and before the compositionend events.private java.lang.String
key_
The key value of the key represented by the event.private static java.util.Map<java.lang.Character,java.lang.Integer>
keyCodeMap
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
location_
The location of the key on the keyboard or other input device.private boolean
metaKey_
Whether or not the "meta" key was pressed during the firing of the event.private boolean
repeat_
Whether the key is being held down such that it is automatically repeating.private int
which_
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
-
-
Constructor Summary
Constructors Constructor Description KeyboardEvent()
Creates a new keyboard event instance.KeyboardEvent(DomNode domNode, java.lang.String type, char character, boolean shiftKey, boolean ctrlKey, boolean altKey)
Creates a new keyboard event instance.KeyboardEvent(DomNode domNode, java.lang.String type, int keyCode, boolean shiftKey, boolean ctrlKey, boolean altKey)
Creates a new keyboard event instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static int
charToKeyCode(char c)
Converts a Java character to a keyCode.private java.lang.String
determineCode()
Determines the value of the 'code' property from the current value of 'keyCode', 'charCode', or 'which'.private java.lang.String
determineKey()
Determines the value of the 'key' property from the current value of 'keyCode', 'charCode', or 'which'.int
getCharCode()
Returns the char code associated with the event.java.lang.String
getCode()
Returns a physical key on the keyboard.boolean
getIsComposing()
Returns whether or not the event is fired after the compositionstart and before the compositionend events.java.lang.String
getKey()
Returns the value of a key or keys pressed by the user.int
getKeyCode()
Returns the key code associated with the event.int
getLocation()
Returns the location of the key on the keyboard.boolean
getMetaKey()
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(java.lang.String type, boolean bubbles, boolean cancelable, java.lang.Object view, java.lang.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
isCtrlKey()
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
isShiftKey()
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(java.lang.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
setCode(java.lang.String code)
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
setKey(java.lang.String key)
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 Detail
-
DOM_KEY_LOCATION_STANDARD
public static final int DOM_KEY_LOCATION_STANDARD
Constant forDOM_KEY_LOCATION_STANDARD
.- See Also:
- Constant Field Values
-
DOM_KEY_LOCATION_LEFT
public static final int DOM_KEY_LOCATION_LEFT
Constant forDOM_KEY_LOCATION_LEFT
.- See Also:
- Constant Field Values
-
DOM_KEY_LOCATION_RIGHT
public static final int DOM_KEY_LOCATION_RIGHT
Constant forDOM_KEY_LOCATION_RIGHT
.- See Also:
- Constant Field Values
-
DOM_KEY_LOCATION_NUMPAD
public static final int DOM_KEY_LOCATION_NUMPAD
Constant forDOM_KEY_LOCATION_NUMPAD
.- See Also:
- Constant Field Values
-
DOM_VK_CANCEL
public static final int DOM_VK_CANCEL
Constant forDOM_VK_CANCEL
.- See Also:
- Constant Field Values
-
DOM_VK_HELP
public static final int DOM_VK_HELP
Constant forDOM_VK_HELP
.- See Also:
- Constant Field Values
-
DOM_VK_TAB
public static final int DOM_VK_TAB
Constant forDOM_VK_TAB
.- See Also:
- Constant Field Values
-
DOM_VK_CLEAR
public static final int DOM_VK_CLEAR
Constant forDOM_VK_CLEAR
.- See Also:
- Constant Field Values
-
DOM_VK_RETURN
public static final int DOM_VK_RETURN
Constant forDOM_VK_RETURN
.- See Also:
- Constant Field Values
-
DOM_VK_SHIFT
public static final int DOM_VK_SHIFT
Constant forDOM_VK_SHIFT
.- See Also:
- Constant Field Values
-
DOM_VK_CONTROL
public static final int DOM_VK_CONTROL
Constant forDOM_VK_CONTROL
.- See Also:
- Constant Field Values
-
DOM_VK_ALT
public static final int DOM_VK_ALT
Constant forDOM_VK_ALT
.- See Also:
- Constant Field Values
-
DOM_VK_PAUSE
public static final int DOM_VK_PAUSE
Constant forDOM_VK_PAUSE
.- See Also:
- Constant Field Values
-
DOM_VK_CAPS_LOCK
public static final int DOM_VK_CAPS_LOCK
Constant forDOM_VK_CAPS_LOCK
.- See Also:
- Constant Field Values
-
DOM_VK_HANGUL
public static final int DOM_VK_HANGUL
Constant forDOM_VK_HANGUL
.- See Also:
- Constant Field Values
-
DOM_VK_KANA
public static final int DOM_VK_KANA
Constant forDOM_VK_KANA
.- See Also:
- Constant Field Values
-
DOM_VK_EISU
public static final int DOM_VK_EISU
Constant forDOM_VK_EISU
.- See Also:
- Constant Field Values
-
DOM_VK_FINAL
public static final int DOM_VK_FINAL
Constant forDOM_VK_FINAL
.- See Also:
- Constant Field Values
-
DOM_VK_JUNJA
public static final int DOM_VK_JUNJA
Constant forDOM_VK_JUNJA
.- See Also:
- Constant Field Values
-
DOM_VK_HANJA
public static final int DOM_VK_HANJA
Constant forDOM_VK_HANJA
.- See Also:
- Constant Field Values
-
DOM_VK_KANJI
public static final int DOM_VK_KANJI
Constant forDOM_VK_KANJI
.- See Also:
- Constant Field Values
-
DOM_VK_ESCAPE
public static final int DOM_VK_ESCAPE
Constant forDOM_VK_ESCAPE
.- See Also:
- Constant Field Values
-
DOM_VK_CONVERT
public static final int DOM_VK_CONVERT
Constant forDOM_VK_CONVERT
.- See Also:
- Constant Field Values
-
DOM_VK_NONCONVERT
public static final int DOM_VK_NONCONVERT
Constant forDOM_VK_NONCONVERT
.- See Also:
- Constant Field Values
-
DOM_VK_ACCEPT
public static final int DOM_VK_ACCEPT
Constant forDOM_VK_ACCEPT
.- See Also:
- Constant Field Values
-
DOM_VK_MODECHANGE
public static final int DOM_VK_MODECHANGE
Constant forDOM_VK_MODECHANGE
.- See Also:
- Constant Field Values
-
DOM_VK_SPACE
public static final int DOM_VK_SPACE
Constant forDOM_VK_SPACE
.- See Also:
- Constant Field Values
-
DOM_VK_PAGE_UP
public static final int DOM_VK_PAGE_UP
Constant forDOM_VK_PAGE_UP
.- See Also:
- Constant Field Values
-
DOM_VK_PAGE_DOWN
public static final int DOM_VK_PAGE_DOWN
Constant forDOM_VK_PAGE_DOWN
.- See Also:
- Constant Field Values
-
DOM_VK_END
public static final int DOM_VK_END
Constant forDOM_VK_END
.- See Also:
- Constant Field Values
-
DOM_VK_HOME
public static final int DOM_VK_HOME
Constant forDOM_VK_HOME
.- See Also:
- Constant Field Values
-
DOM_VK_LEFT
public static final int DOM_VK_LEFT
Constant forDOM_VK_LEFT
.- See Also:
- Constant Field Values
-
DOM_VK_UP
public static final int DOM_VK_UP
Constant forDOM_VK_UP
.- See Also:
- Constant Field Values
-
DOM_VK_RIGHT
public static final int DOM_VK_RIGHT
Constant forDOM_VK_RIGHT
.- See Also:
- Constant Field Values
-
DOM_VK_SELECT
public static final int DOM_VK_SELECT
Constant forDOM_VK_SELECT
.- See Also:
- Constant Field Values
-
DOM_VK_DOWN
public static final int DOM_VK_DOWN
Constant forDOM_VK_DOWN
.- See Also:
- Constant Field Values
-
DOM_VK_PRINT
public static final int DOM_VK_PRINT
Constant forDOM_VK_PRINT
.- See Also:
- Constant Field Values
-
DOM_VK_EXECUTE
public static final int DOM_VK_EXECUTE
Constant forDOM_VK_EXECUTE
.- See Also:
- Constant Field Values
-
DOM_VK_PRINTSCREEN
public static final int DOM_VK_PRINTSCREEN
Constant forDOM_VK_PRINTSCREEN
.- See Also:
- Constant Field Values
-
DOM_VK_INSERT
public static final int DOM_VK_INSERT
Constant forDOM_VK_INSERT
.- See Also:
- Constant Field Values
-
DOM_VK_DELETE
public static final int DOM_VK_DELETE
Constant forDOM_VK_DELETE
.- See Also:
- Constant Field Values
-
DOM_VK_0
public static final int DOM_VK_0
Constant forDOM_VK_0
.- See Also:
- Constant Field Values
-
DOM_VK_1
public static final int DOM_VK_1
Constant forDOM_VK_1
.- See Also:
- Constant Field Values
-
DOM_VK_2
public static final int DOM_VK_2
Constant forDOM_VK_2
.- See Also:
- Constant Field Values
-
DOM_VK_3
public static final int DOM_VK_3
Constant forDOM_VK_3
.- See Also:
- Constant Field Values
-
DOM_VK_4
public static final int DOM_VK_4
Constant forDOM_VK_4
.- See Also:
- Constant Field Values
-
DOM_VK_5
public static final int DOM_VK_5
Constant forDOM_VK_5
.- See Also:
- Constant Field Values
-
DOM_VK_6
public static final int DOM_VK_6
Constant forDOM_VK_6
.- See Also:
- Constant Field Values
-
DOM_VK_7
public static final int DOM_VK_7
Constant forDOM_VK_7
.- See Also:
- Constant Field Values
-
DOM_VK_8
public static final int DOM_VK_8
Constant forDOM_VK_8
.- See Also:
- Constant Field Values
-
DOM_VK_9
public static final int DOM_VK_9
Constant forDOM_VK_9
.- See Also:
- Constant Field Values
-
DOM_VK_COLON
public static final int DOM_VK_COLON
Constant forDOM_VK_COLON
.- See Also:
- Constant Field Values
-
DOM_VK_SEMICOLON
public static final int DOM_VK_SEMICOLON
Constant forDOM_VK_SEMICOLON
.- See Also:
- Constant Field Values
-
DOM_VK_LESS_THAN
public static final int DOM_VK_LESS_THAN
Constant forDOM_VK_LESS_THAN
.- See Also:
- Constant Field Values
-
DOM_VK_EQUALS
public static final int DOM_VK_EQUALS
Constant forDOM_VK_EQUALS
.- See Also:
- Constant Field Values
-
DOM_VK_GREATER_THAN
public static final int DOM_VK_GREATER_THAN
Constant forDOM_VK_GREATER_THAN
.- See Also:
- Constant Field Values
-
DOM_VK_QUESTION_MARK
public static final int DOM_VK_QUESTION_MARK
Constant forDOM_VK_QUESTION_MARK
.- See Also:
- Constant Field Values
-
DOM_VK_AT
public static final int DOM_VK_AT
Constant forDOM_VK_AT
.- See Also:
- Constant Field Values
-
DOM_VK_A
public static final int DOM_VK_A
Constant forDOM_VK_A
.- See Also:
- Constant Field Values
-
DOM_VK_B
public static final int DOM_VK_B
Constant forDOM_VK_B
.- See Also:
- Constant Field Values
-
DOM_VK_C
public static final int DOM_VK_C
Constant forDOM_VK_C
.- See Also:
- Constant Field Values
-
DOM_VK_D
public static final int DOM_VK_D
Constant forDOM_VK_D
.- See Also:
- Constant Field Values
-
DOM_VK_E
public static final int DOM_VK_E
Constant forDOM_VK_E
.- See Also:
- Constant Field Values
-
DOM_VK_F
public static final int DOM_VK_F
Constant forDOM_VK_F
.- See Also:
- Constant Field Values
-
DOM_VK_G
public static final int DOM_VK_G
Constant forDOM_VK_G
.- See Also:
- Constant Field Values
-
DOM_VK_H
public static final int DOM_VK_H
Constant forDOM_VK_H
.- See Also:
- Constant Field Values
-
DOM_VK_I
public static final int DOM_VK_I
Constant forDOM_VK_I
.- See Also:
- Constant Field Values
-
DOM_VK_J
public static final int DOM_VK_J
Constant forDOM_VK_J
.- See Also:
- Constant Field Values
-
DOM_VK_K
public static final int DOM_VK_K
Constant forDOM_VK_K
.- See Also:
- Constant Field Values
-
DOM_VK_L
public static final int DOM_VK_L
Constant forDOM_VK_L
.- See Also:
- Constant Field Values
-
DOM_VK_M
public static final int DOM_VK_M
Constant forDOM_VK_M
.- See Also:
- Constant Field Values
-
DOM_VK_N
public static final int DOM_VK_N
Constant forDOM_VK_N
.- See Also:
- Constant Field Values
-
DOM_VK_O
public static final int DOM_VK_O
Constant forDOM_VK_O
.- See Also:
- Constant Field Values
-
DOM_VK_BACK_SPACE
public static final int DOM_VK_BACK_SPACE
Constant forDOM_VK_BACK_SPACE
.- See Also:
- Constant Field Values
-
DOM_VK_P
public static final int DOM_VK_P
Constant forDOM_VK_P
.- See Also:
- Constant Field Values
-
DOM_VK_Q
public static final int DOM_VK_Q
Constant forDOM_VK_Q
.- See Also:
- Constant Field Values
-
DOM_VK_R
public static final int DOM_VK_R
Constant forDOM_VK_R
.- See Also:
- Constant Field Values
-
DOM_VK_S
public static final int DOM_VK_S
Constant forDOM_VK_S
.- See Also:
- Constant Field Values
-
DOM_VK_T
public static final int DOM_VK_T
Constant forDOM_VK_T
.- See Also:
- Constant Field Values
-
DOM_VK_U
public static final int DOM_VK_U
Constant forDOM_VK_U
.- See Also:
- Constant Field Values
-
DOM_VK_V
public static final int DOM_VK_V
Constant forDOM_VK_V
.- See Also:
- Constant Field Values
-
DOM_VK_W
public static final int DOM_VK_W
Constant forDOM_VK_W
.- See Also:
- Constant Field Values
-
DOM_VK_X
public static final int DOM_VK_X
Constant forDOM_VK_X
.- See Also:
- Constant Field Values
-
DOM_VK_Y
public static final int DOM_VK_Y
Constant forDOM_VK_Y
.- See Also:
- Constant Field Values
-
DOM_VK_Z
public static final int DOM_VK_Z
Constant forDOM_VK_Z
.- See Also:
- Constant Field Values
-
DOM_VK_WIN
public static final int DOM_VK_WIN
Constant forDOM_VK_WIN
.- See Also:
- Constant Field Values
-
DOM_VK_CONTEXT_MENU
public static final int DOM_VK_CONTEXT_MENU
Constant forDOM_VK_CONTEXT_MENU
.- See Also:
- Constant Field Values
-
DOM_VK_SLEEP
public static final int DOM_VK_SLEEP
Constant forDOM_VK_SLEEP
.- See Also:
- Constant Field Values
-
DOM_VK_NUMPAD0
public static final int DOM_VK_NUMPAD0
Constant forDOM_VK_NUMPAD0
.- See Also:
- Constant Field Values
-
DOM_VK_NUMPAD1
public static final int DOM_VK_NUMPAD1
Constant forDOM_VK_NUMPAD1
.- See Also:
- Constant Field Values
-
DOM_VK_NUMPAD2
public static final int DOM_VK_NUMPAD2
Constant forDOM_VK_NUMPAD2
.- See Also:
- Constant Field Values
-
DOM_VK_NUMPAD3
public static final int DOM_VK_NUMPAD3
Constant forDOM_VK_NUMPAD3
.- See Also:
- Constant Field Values
-
DOM_VK_NUMPAD4
public static final int DOM_VK_NUMPAD4
Constant forDOM_VK_NUMPAD4
.- See Also:
- Constant Field Values
-
DOM_VK_NUMPAD5
public static final int DOM_VK_NUMPAD5
Constant forDOM_VK_NUMPAD5
.- See Also:
- Constant Field Values
-
DOM_VK_NUMPAD6
public static final int DOM_VK_NUMPAD6
Constant forDOM_VK_NUMPAD6
.- See Also:
- Constant Field Values
-
DOM_VK_NUMPAD7
public static final int DOM_VK_NUMPAD7
Constant forDOM_VK_NUMPAD7
.- See Also:
- Constant Field Values
-
DOM_VK_NUMPAD8
public static final int DOM_VK_NUMPAD8
Constant forDOM_VK_NUMPAD8
.- See Also:
- Constant Field Values
-
DOM_VK_NUMPAD9
public static final int DOM_VK_NUMPAD9
Constant forDOM_VK_NUMPAD9
.- See Also:
- Constant Field Values
-
DOM_VK_MULTIPLY
public static final int DOM_VK_MULTIPLY
Constant forDOM_VK_MULTIPLY
.- See Also:
- Constant Field Values
-
DOM_VK_ADD
public static final int DOM_VK_ADD
Constant forDOM_VK_ADD
.- See Also:
- Constant Field Values
-
DOM_VK_SEPARATOR
public static final int DOM_VK_SEPARATOR
Constant forDOM_VK_SEPARATOR
.- See Also:
- Constant Field Values
-
DOM_VK_SUBTRACT
public static final int DOM_VK_SUBTRACT
Constant forDOM_VK_SUBTRACT
.- See Also:
- Constant Field Values
-
DOM_VK_DECIMAL
public static final int DOM_VK_DECIMAL
Constant forDOM_VK_DECIMAL
.- See Also:
- Constant Field Values
-
DOM_VK_DIVIDE
public static final int DOM_VK_DIVIDE
Constant forDOM_VK_DIVIDE
.- See Also:
- Constant Field Values
-
DOM_VK_F1
public static final int DOM_VK_F1
Constant forDOM_VK_F1
.- See Also:
- Constant Field Values
-
DOM_VK_F2
public static final int DOM_VK_F2
Constant forDOM_VK_F2
.- See Also:
- Constant Field Values
-
DOM_VK_F3
public static final int DOM_VK_F3
Constant forDOM_VK_F3
.- See Also:
- Constant Field Values
-
DOM_VK_F4
public static final int DOM_VK_F4
Constant forDOM_VK_F4
.- See Also:
- Constant Field Values
-
DOM_VK_F5
public static final int DOM_VK_F5
Constant forDOM_VK_F5
.- See Also:
- Constant Field Values
-
DOM_VK_F6
public static final int DOM_VK_F6
Constant forDOM_VK_F6
.- See Also:
- Constant Field Values
-
DOM_VK_F7
public static final int DOM_VK_F7
Constant forDOM_VK_F7
.- See Also:
- Constant Field Values
-
DOM_VK_F8
public static final int DOM_VK_F8
Constant forDOM_VK_F8
.- See Also:
- Constant Field Values
-
DOM_VK_F9
public static final int DOM_VK_F9
Constant forDOM_VK_F9
.- See Also:
- Constant Field Values
-
DOM_VK_F10
public static final int DOM_VK_F10
Constant forDOM_VK_F10
.- See Also:
- Constant Field Values
-
DOM_VK_F11
public static final int DOM_VK_F11
Constant forDOM_VK_F11
.- See Also:
- Constant Field Values
-
DOM_VK_F12
public static final int DOM_VK_F12
Constant forDOM_VK_F12
.- See Also:
- Constant Field Values
-
DOM_VK_F13
public static final int DOM_VK_F13
Constant forDOM_VK_F13
.- See Also:
- Constant Field Values
-
DOM_VK_F14
public static final int DOM_VK_F14
Constant forDOM_VK_F14
.- See Also:
- Constant Field Values
-
DOM_VK_F15
public static final int DOM_VK_F15
Constant forDOM_VK_F15
.- See Also:
- Constant Field Values
-
DOM_VK_F16
public static final int DOM_VK_F16
Constant forDOM_VK_F16
.- See Also:
- Constant Field Values
-
DOM_VK_F17
public static final int DOM_VK_F17
Constant forDOM_VK_F17
.- See Also:
- Constant Field Values
-
DOM_VK_F18
public static final int DOM_VK_F18
Constant forDOM_VK_F18
.- See Also:
- Constant Field Values
-
DOM_VK_F19
public static final int DOM_VK_F19
Constant forDOM_VK_F19
.- See Also:
- Constant Field Values
-
DOM_VK_F20
public static final int DOM_VK_F20
Constant forDOM_VK_F20
.- See Also:
- Constant Field Values
-
DOM_VK_F21
public static final int DOM_VK_F21
Constant forDOM_VK_F21
.- See Also:
- Constant Field Values
-
DOM_VK_F22
public static final int DOM_VK_F22
Constant forDOM_VK_F22
.- See Also:
- Constant Field Values
-
DOM_VK_F23
public static final int DOM_VK_F23
Constant forDOM_VK_F23
.- See Also:
- Constant Field Values
-
DOM_VK_F24
public static final int DOM_VK_F24
Constant forDOM_VK_F24
.- See Also:
- Constant Field Values
-
DOM_VK_NUM_LOCK
public static final int DOM_VK_NUM_LOCK
Constant forDOM_VK_NUM_LOCK
.- See Also:
- Constant Field Values
-
DOM_VK_SCROLL_LOCK
public static final int DOM_VK_SCROLL_LOCK
Constant forDOM_VK_SCROLL_LOCK
.- See Also:
- Constant Field Values
-
DOM_VK_WIN_OEM_FJ_JISHO
public static final int DOM_VK_WIN_OEM_FJ_JISHO
Constant forDOM_VK_WIN_OEM_FJ_JISHO
.- See Also:
- Constant Field Values
-
DOM_VK_WIN_OEM_FJ_MASSHOU
public static final int DOM_VK_WIN_OEM_FJ_MASSHOU
Constant forDOM_VK_WIN_OEM_FJ_MASSHOU
.- See Also:
- Constant Field Values
-
DOM_VK_WIN_OEM_FJ_TOUROKU
public static final int DOM_VK_WIN_OEM_FJ_TOUROKU
Constant forDOM_VK_WIN_OEM_FJ_TOUROKU
.- See Also:
- Constant Field Values
-
DOM_VK_WIN_OEM_FJ_LOYA
public static final int DOM_VK_WIN_OEM_FJ_LOYA
Constant forDOM_VK_WIN_OEM_FJ_LOYA
.- See Also:
- Constant Field Values
-
DOM_VK_WIN_OEM_FJ_ROYA
public static final int DOM_VK_WIN_OEM_FJ_ROYA
Constant forDOM_VK_WIN_OEM_FJ_ROYA
.- See Also:
- Constant Field Values
-
DOM_VK_CIRCUMFLEX
public static final int DOM_VK_CIRCUMFLEX
Constant forDOM_VK_CIRCUMFLEX
.- See Also:
- Constant Field Values
-
DOM_VK_EXCLAMATION
public static final int DOM_VK_EXCLAMATION
Constant forDOM_VK_EXCLAMATION
.- See Also:
- Constant Field Values
-
DOM_VK_DOUBLE_QUOTE
public static final int DOM_VK_DOUBLE_QUOTE
Constant forDOM_VK_DOUBLE_QUOTE
.- See Also:
- Constant Field Values
-
DOM_VK_HASH
public static final int DOM_VK_HASH
Constant forDOM_VK_HASH
.- See Also:
- Constant Field Values
-
DOM_VK_DOLLAR
public static final int DOM_VK_DOLLAR
Constant forDOM_VK_DOLLAR
.- See Also:
- Constant Field Values
-
DOM_VK_PERCENT
public static final int DOM_VK_PERCENT
Constant forDOM_VK_PERCENT
.- See Also:
- Constant Field Values
-
DOM_VK_AMPERSAND
public static final int DOM_VK_AMPERSAND
Constant forDOM_VK_AMPERSAND
.- See Also:
- Constant Field Values
-
DOM_VK_UNDERSCORE
public static final int DOM_VK_UNDERSCORE
Constant forDOM_VK_UNDERSCORE
.- See Also:
- Constant Field Values
-
DOM_VK_OPEN_PAREN
public static final int DOM_VK_OPEN_PAREN
Constant forDOM_VK_OPEN_PAREN
.- See Also:
- Constant Field Values
-
DOM_VK_CLOSE_PAREN
public static final int DOM_VK_CLOSE_PAREN
Constant forDOM_VK_CLOSE_PAREN
.- See Also:
- Constant Field Values
-
DOM_VK_ASTERISK
public static final int DOM_VK_ASTERISK
Constant forDOM_VK_ASTERISK
.- See Also:
- Constant Field Values
-
DOM_VK_PLUS
public static final int DOM_VK_PLUS
Constant forDOM_VK_PLUS
.- See Also:
- Constant Field Values
-
DOM_VK_PIPE
public static final int DOM_VK_PIPE
Constant forDOM_VK_PIPE
.- See Also:
- Constant Field Values
-
DOM_VK_HYPHEN_MINUS
public static final int DOM_VK_HYPHEN_MINUS
Constant forDOM_VK_HYPHEN_MINUS
.- See Also:
- Constant Field Values
-
DOM_VK_OPEN_CURLY_BRACKET
public static final int DOM_VK_OPEN_CURLY_BRACKET
Constant forDOM_VK_OPEN_CURLY_BRACKET
.- See Also:
- Constant Field Values
-
DOM_VK_CLOSE_CURLY_BRACKET
public static final int DOM_VK_CLOSE_CURLY_BRACKET
Constant forDOM_VK_CLOSE_CURLY_BRACKET
.- See Also:
- Constant Field Values
-
DOM_VK_TILDE
public static final int DOM_VK_TILDE
Constant forDOM_VK_TILDE
.- See Also:
- Constant Field Values
-
DOM_VK_VOLUME_MUTE
public static final int DOM_VK_VOLUME_MUTE
Constant forDOM_VK_VOLUME_MUTE
.- See Also:
- Constant Field Values
-
DOM_VK_VOLUME_DOWN
public static final int DOM_VK_VOLUME_DOWN
Constant forDOM_VK_VOLUME_DOWN
.- See Also:
- Constant Field Values
-
DOM_VK_VOLUME_UP
public static final int DOM_VK_VOLUME_UP
Constant forDOM_VK_VOLUME_UP
.- See Also:
- Constant Field Values
-
DOM_VK_COMMA
public static final int DOM_VK_COMMA
Constant forDOM_VK_COMMA
.- See Also:
- Constant Field Values
-
DOM_VK_PERIOD
public static final int DOM_VK_PERIOD
Constant forDOM_VK_PERIOD
.- See Also:
- Constant Field Values
-
DOM_VK_SLASH
public static final int DOM_VK_SLASH
Constant forDOM_VK_SLASH
.- See Also:
- Constant Field Values
-
DOM_VK_BACK_QUOTE
public static final int DOM_VK_BACK_QUOTE
Constant forDOM_VK_BACK_QUOTE
.- See Also:
- Constant Field Values
-
DOM_VK_OPEN_BRACKET
public static final int DOM_VK_OPEN_BRACKET
Constant forDOM_VK_OPEN_BRACKET
.- See Also:
- Constant Field Values
-
DOM_VK_BACK_SLASH
public static final int DOM_VK_BACK_SLASH
Constant forDOM_VK_BACK_SLASH
.- See Also:
- Constant Field Values
-
DOM_VK_CLOSE_BRACKET
public static final int DOM_VK_CLOSE_BRACKET
Constant forDOM_VK_CLOSE_BRACKET
.- See Also:
- Constant Field Values
-
DOM_VK_QUOTE
public static final int DOM_VK_QUOTE
Constant forDOM_VK_QUOTE
.- See Also:
- Constant Field Values
-
DOM_VK_META
public static final int DOM_VK_META
Constant forDOM_VK_META
.- See Also:
- Constant Field Values
-
DOM_VK_ALTGR
public static final int DOM_VK_ALTGR
Constant forDOM_VK_ALTGR
.- See Also:
- Constant Field Values
-
DOM_VK_WIN_ICO_HELP
public static final int DOM_VK_WIN_ICO_HELP
Constant forDOM_VK_WIN_ICO_HELP
.- See Also:
- Constant Field Values
-
DOM_VK_WIN_ICO_00
public static final int DOM_VK_WIN_ICO_00
Constant forDOM_VK_WIN_ICO_00
.- See Also:
- Constant Field Values
-
DOM_VK_PROCESSKEY
public static final int DOM_VK_PROCESSKEY
Constant forDOM_VK_PROCESSKEY
.- See Also:
- Constant Field Values
-
DOM_VK_WIN_ICO_CLEAR
public static final int DOM_VK_WIN_ICO_CLEAR
Constant forDOM_VK_WIN_ICO_CLEAR
.- See Also:
- Constant Field Values
-
DOM_VK_WIN_OEM_RESET
public static final int DOM_VK_WIN_OEM_RESET
Constant forDOM_VK_WIN_OEM_RESET
.- See Also:
- Constant Field Values
-
DOM_VK_WIN_OEM_JUMP
public static final int DOM_VK_WIN_OEM_JUMP
Constant forDOM_VK_WIN_OEM_JUMP
.- See Also:
- Constant Field Values
-
DOM_VK_WIN_OEM_PA1
public static final int DOM_VK_WIN_OEM_PA1
Constant forDOM_VK_WIN_OEM_PA1
.- See Also:
- Constant Field Values
-
DOM_VK_WIN_OEM_PA2
public static final int DOM_VK_WIN_OEM_PA2
Constant forDOM_VK_WIN_OEM_PA2
.- See Also:
- Constant Field Values
-
DOM_VK_WIN_OEM_PA3
public static final int DOM_VK_WIN_OEM_PA3
Constant forDOM_VK_WIN_OEM_PA3
.- See Also:
- Constant Field Values
-
DOM_VK_WIN_OEM_WSCTRL
public static final int DOM_VK_WIN_OEM_WSCTRL
Constant forDOM_VK_WIN_OEM_WSCTRL
.- See Also:
- Constant Field Values
-
DOM_VK_WIN_OEM_CUSEL
public static final int DOM_VK_WIN_OEM_CUSEL
Constant forDOM_VK_WIN_OEM_CUSEL
.- See Also:
- Constant Field Values
-
DOM_VK_WIN_OEM_ATTN
public static final int DOM_VK_WIN_OEM_ATTN
Constant forDOM_VK_WIN_OEM_ATTN
.- See Also:
- Constant Field Values
-
DOM_VK_WIN_OEM_FINISH
public static final int DOM_VK_WIN_OEM_FINISH
Constant forDOM_VK_WIN_OEM_FINISH
.- See Also:
- Constant Field Values
-
DOM_VK_WIN_OEM_COPY
public static final int DOM_VK_WIN_OEM_COPY
Constant forDOM_VK_WIN_OEM_COPY
.- See Also:
- Constant Field Values
-
DOM_VK_WIN_OEM_AUTO
public static final int DOM_VK_WIN_OEM_AUTO
Constant forDOM_VK_WIN_OEM_AUTO
.- See Also:
- Constant Field Values
-
DOM_VK_WIN_OEM_ENLW
public static final int DOM_VK_WIN_OEM_ENLW
Constant forDOM_VK_WIN_OEM_ENLW
.- See Also:
- Constant Field Values
-
DOM_VK_WIN_OEM_BACKTAB
public static final int DOM_VK_WIN_OEM_BACKTAB
Constant forDOM_VK_WIN_OEM_BACKTAB
.- See Also:
- Constant Field Values
-
DOM_VK_ATTN
public static final int DOM_VK_ATTN
Constant forDOM_VK_ATTN
.- See Also:
- Constant Field Values
-
DOM_VK_CRSEL
public static final int DOM_VK_CRSEL
Constant forDOM_VK_CRSEL
.- See Also:
- Constant Field Values
-
DOM_VK_EXSEL
public static final int DOM_VK_EXSEL
Constant forDOM_VK_EXSEL
.- See Also:
- Constant Field Values
-
DOM_VK_EREOF
public static final int DOM_VK_EREOF
Constant forDOM_VK_EREOF
.- See Also:
- Constant Field Values
-
DOM_VK_PLAY
public static final int DOM_VK_PLAY
Constant forDOM_VK_PLAY
.- See Also:
- Constant Field Values
-
DOM_VK_ZOOM
public static final int DOM_VK_ZOOM
Constant forDOM_VK_ZOOM
.- See Also:
- Constant Field Values
-
DOM_VK_PA1
public static final int DOM_VK_PA1
Constant forDOM_VK_PA1
.- See Also:
- Constant Field Values
-
DOM_VK_WIN_OEM_CLEAR
public static final int DOM_VK_WIN_OEM_CLEAR
Constant forDOM_VK_WIN_OEM_CLEAR
.- See Also:
- Constant Field Values
-
keyCodeMap
private static final java.util.Map<java.lang.Character,java.lang.Integer> 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_
private java.lang.String key_
The key value of the key represented by the event.
-
code_
private java.lang.String 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 Detail
-
KeyboardEvent
public KeyboardEvent()
Creates a new keyboard event instance.
-
KeyboardEvent
public KeyboardEvent(DomNode domNode, java.lang.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, java.lang.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 Detail
-
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:
- DOM 3 Events
-
determineKey
private java.lang.String determineKey()
Determines the value of the 'key' property from the current value of 'keyCode', 'charCode', or 'which'.- Returns:
- the key value
-
determineCode
private java.lang.String determineCode()
Determines the value of the 'code' property from the current value of 'keyCode', 'charCode', or 'which'.- Returns:
- the code value
-
jsConstructor
public void jsConstructor(java.lang.String type, org.htmlunit.corejs.javascript.ScriptableObject details)
JavaScript constructor.- Overrides:
jsConstructor
in classUIEvent
- Parameters:
type
- the event typedetails
- the event details (optional)
-
initKeyboardEvent
public void initKeyboardEvent(java.lang.String type, boolean bubbles, boolean cancelable, java.lang.Object view, java.lang.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
public java.lang.String 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
protected void setKey(java.lang.String key)
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
public java.lang.String getCode()
Returns a physical key on the keyboard.- Returns:
- a physical key on the keyboard
-
setCode
protected void setCode(java.lang.String code)
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
-
-