public class KeyboardEvent extends UIEvent
org.htmlunit.corejs.javascript.ScriptableObject.KeyComparator
Modifier and Type | Field and Description |
---|---|
static int |
DOM_KEY_LOCATION_LEFT
Constant for
DOM_KEY_LOCATION_LEFT . |
static int |
DOM_KEY_LOCATION_NUMPAD
Constant for
DOM_KEY_LOCATION_NUMPAD . |
static int |
DOM_KEY_LOCATION_RIGHT
Constant for
DOM_KEY_LOCATION_RIGHT . |
static int |
DOM_KEY_LOCATION_STANDARD
Constant for
DOM_KEY_LOCATION_STANDARD . |
static int |
DOM_VK_0
Constant for
DOM_VK_0 . |
static int |
DOM_VK_1
Constant for
DOM_VK_1 . |
static int |
DOM_VK_2
Constant for
DOM_VK_2 . |
static int |
DOM_VK_3
Constant for
DOM_VK_3 . |
static int |
DOM_VK_4
Constant for
DOM_VK_4 . |
static int |
DOM_VK_5
Constant for
DOM_VK_5 . |
static int |
DOM_VK_6
Constant for
DOM_VK_6 . |
static int |
DOM_VK_7
Constant for
DOM_VK_7 . |
static int |
DOM_VK_8
Constant for
DOM_VK_8 . |
static int |
DOM_VK_9
Constant for
DOM_VK_9 . |
static int |
DOM_VK_A
Constant for
DOM_VK_A . |
static int |
DOM_VK_ACCEPT
Constant for
DOM_VK_ACCEPT . |
static int |
DOM_VK_ADD
Constant for
DOM_VK_ADD . |
static int |
DOM_VK_ALT
Constant for
DOM_VK_ALT . |
static int |
DOM_VK_ALTGR
Constant for
DOM_VK_ALTGR . |
static int |
DOM_VK_AMPERSAND
Constant for
DOM_VK_AMPERSAND . |
static int |
DOM_VK_ASTERISK
Constant for
DOM_VK_ASTERISK . |
static int |
DOM_VK_AT
Constant for
DOM_VK_AT . |
static int |
DOM_VK_ATTN
Constant for
DOM_VK_ATTN . |
static int |
DOM_VK_B
Constant for
DOM_VK_B . |
static int |
DOM_VK_BACK_QUOTE
Constant for
DOM_VK_BACK_QUOTE . |
static int |
DOM_VK_BACK_SLASH
Constant for
DOM_VK_BACK_SLASH . |
static int |
DOM_VK_BACK_SPACE
Constant for
DOM_VK_BACK_SPACE . |
static int |
DOM_VK_C
Constant for
DOM_VK_C . |
static int |
DOM_VK_CANCEL
Constant for
DOM_VK_CANCEL . |
static int |
DOM_VK_CAPS_LOCK
Constant for
DOM_VK_CAPS_LOCK . |
static int |
DOM_VK_CIRCUMFLEX
Constant for
DOM_VK_CIRCUMFLEX . |
static int |
DOM_VK_CLEAR
Constant for
DOM_VK_CLEAR . |
static int |
DOM_VK_CLOSE_BRACKET
Constant for
DOM_VK_CLOSE_BRACKET . |
static int |
DOM_VK_CLOSE_CURLY_BRACKET
Constant for
DOM_VK_CLOSE_CURLY_BRACKET . |
static int |
DOM_VK_CLOSE_PAREN
Constant for
DOM_VK_CLOSE_PAREN . |
static int |
DOM_VK_COLON
Constant for
DOM_VK_COLON . |
static int |
DOM_VK_COMMA
Constant for
DOM_VK_COMMA . |
static int |
DOM_VK_CONTEXT_MENU
Constant for
DOM_VK_CONTEXT_MENU . |
static int |
DOM_VK_CONTROL
Constant for
DOM_VK_CONTROL . |
static int |
DOM_VK_CONVERT
Constant for
DOM_VK_CONVERT . |
static int |
DOM_VK_CRSEL
Constant for
DOM_VK_CRSEL . |
static int |
DOM_VK_D
Constant for
DOM_VK_D . |
static int |
DOM_VK_DECIMAL
Constant for
DOM_VK_DECIMAL . |
static int |
DOM_VK_DELETE
Constant for
DOM_VK_DELETE . |
static int |
DOM_VK_DIVIDE
Constant for
DOM_VK_DIVIDE . |
static int |
DOM_VK_DOLLAR
Constant for
DOM_VK_DOLLAR . |
static int |
DOM_VK_DOUBLE_QUOTE
Constant for
DOM_VK_DOUBLE_QUOTE . |
static int |
DOM_VK_DOWN
Constant for
DOM_VK_DOWN . |
static int |
DOM_VK_E
Constant for
DOM_VK_E . |
static int |
DOM_VK_EISU
Constant for
DOM_VK_EISU . |
static int |
DOM_VK_END
Constant for
DOM_VK_END . |
static int |
DOM_VK_EQUALS
Constant for
DOM_VK_EQUALS . |
static int |
DOM_VK_EREOF
Constant for
DOM_VK_EREOF . |
static int |
DOM_VK_ESCAPE
Constant for
DOM_VK_ESCAPE . |
static int |
DOM_VK_EXCLAMATION
Constant for
DOM_VK_EXCLAMATION . |
static int |
DOM_VK_EXECUTE
Constant for
DOM_VK_EXECUTE . |
static int |
DOM_VK_EXSEL
Constant for
DOM_VK_EXSEL . |
static int |
DOM_VK_F
Constant for
DOM_VK_F . |
static int |
DOM_VK_F1
Constant for
DOM_VK_F1 . |
static int |
DOM_VK_F10
Constant for
DOM_VK_F10 . |
static int |
DOM_VK_F11
Constant for
DOM_VK_F11 . |
static int |
DOM_VK_F12
Constant for
DOM_VK_F12 . |
static int |
DOM_VK_F13
Constant for
DOM_VK_F13 . |
static int |
DOM_VK_F14
Constant for
DOM_VK_F14 . |
static int |
DOM_VK_F15
Constant for
DOM_VK_F15 . |
static int |
DOM_VK_F16
Constant for
DOM_VK_F16 . |
static int |
DOM_VK_F17
Constant for
DOM_VK_F17 . |
static int |
DOM_VK_F18
Constant for
DOM_VK_F18 . |
static int |
DOM_VK_F19
Constant for
DOM_VK_F19 . |
static int |
DOM_VK_F2
Constant for
DOM_VK_F2 . |
static int |
DOM_VK_F20
Constant for
DOM_VK_F20 . |
static int |
DOM_VK_F21
Constant for
DOM_VK_F21 . |
static int |
DOM_VK_F22
Constant for
DOM_VK_F22 . |
static int |
DOM_VK_F23
Constant for
DOM_VK_F23 . |
static int |
DOM_VK_F24
Constant for
DOM_VK_F24 . |
static int |
DOM_VK_F3
Constant for
DOM_VK_F3 . |
static int |
DOM_VK_F4
Constant for
DOM_VK_F4 . |
static int |
DOM_VK_F5
Constant for
DOM_VK_F5 . |
static int |
DOM_VK_F6
Constant for
DOM_VK_F6 . |
static int |
DOM_VK_F7
Constant for
DOM_VK_F7 . |
static int |
DOM_VK_F8
Constant for
DOM_VK_F8 . |
static int |
DOM_VK_F9
Constant for
DOM_VK_F9 . |
static int |
DOM_VK_FINAL
Constant for
DOM_VK_FINAL . |
static int |
DOM_VK_G
Constant for
DOM_VK_G . |
static int |
DOM_VK_GREATER_THAN
Constant for
DOM_VK_GREATER_THAN . |
static int |
DOM_VK_H
Constant for
DOM_VK_H . |
static int |
DOM_VK_HANGUL
Constant for
DOM_VK_HANGUL . |
static int |
DOM_VK_HANJA
Constant for
DOM_VK_HANJA . |
static int |
DOM_VK_HASH
Constant for
DOM_VK_HASH . |
static int |
DOM_VK_HELP
Constant for
DOM_VK_HELP . |
static int |
DOM_VK_HOME
Constant for
DOM_VK_HOME . |
static int |
DOM_VK_HYPHEN_MINUS
Constant for
DOM_VK_HYPHEN_MINUS . |
static int |
DOM_VK_I
Constant for
DOM_VK_I . |
static int |
DOM_VK_INSERT
Constant for
DOM_VK_INSERT . |
static int |
DOM_VK_J
Constant for
DOM_VK_J . |
static int |
DOM_VK_JUNJA
Constant for
DOM_VK_JUNJA . |
static int |
DOM_VK_K
Constant for
DOM_VK_K . |
static int |
DOM_VK_KANA
Constant for
DOM_VK_KANA . |
static int |
DOM_VK_KANJI
Constant for
DOM_VK_KANJI . |
static int |
DOM_VK_L
Constant for
DOM_VK_L . |
static int |
DOM_VK_LEFT
Constant for
DOM_VK_LEFT . |
static int |
DOM_VK_LESS_THAN
Constant for
DOM_VK_LESS_THAN . |
static int |
DOM_VK_M
Constant for
DOM_VK_M . |
static int |
DOM_VK_META
Constant for
DOM_VK_META . |
static int |
DOM_VK_MODECHANGE
Constant for
DOM_VK_MODECHANGE . |
static int |
DOM_VK_MULTIPLY
Constant for
DOM_VK_MULTIPLY . |
static int |
DOM_VK_N
Constant for
DOM_VK_N . |
static int |
DOM_VK_NONCONVERT
Constant for
DOM_VK_NONCONVERT . |
static int |
DOM_VK_NUM_LOCK
Constant for
DOM_VK_NUM_LOCK . |
static int |
DOM_VK_NUMPAD0
Constant for
DOM_VK_NUMPAD0 . |
static int |
DOM_VK_NUMPAD1
Constant for
DOM_VK_NUMPAD1 . |
static int |
DOM_VK_NUMPAD2
Constant for
DOM_VK_NUMPAD2 . |
static int |
DOM_VK_NUMPAD3
Constant for
DOM_VK_NUMPAD3 . |
static int |
DOM_VK_NUMPAD4
Constant for
DOM_VK_NUMPAD4 . |
static int |
DOM_VK_NUMPAD5
Constant for
DOM_VK_NUMPAD5 . |
static int |
DOM_VK_NUMPAD6
Constant for
DOM_VK_NUMPAD6 . |
static int |
DOM_VK_NUMPAD7
Constant for
DOM_VK_NUMPAD7 . |
static int |
DOM_VK_NUMPAD8
Constant for
DOM_VK_NUMPAD8 . |
static int |
DOM_VK_NUMPAD9
Constant for
DOM_VK_NUMPAD9 . |
static int |
DOM_VK_O
Constant for
DOM_VK_O . |
static int |
DOM_VK_OPEN_BRACKET
Constant for
DOM_VK_OPEN_BRACKET . |
static int |
DOM_VK_OPEN_CURLY_BRACKET
Constant for
DOM_VK_OPEN_CURLY_BRACKET . |
static int |
DOM_VK_OPEN_PAREN
Constant for
DOM_VK_OPEN_PAREN . |
static int |
DOM_VK_P
Constant for
DOM_VK_P . |
static int |
DOM_VK_PA1
Constant for
DOM_VK_PA1 . |
static int |
DOM_VK_PAGE_DOWN
Constant for
DOM_VK_PAGE_DOWN . |
static int |
DOM_VK_PAGE_UP
Constant for
DOM_VK_PAGE_UP . |
static int |
DOM_VK_PAUSE
Constant for
DOM_VK_PAUSE . |
static int |
DOM_VK_PERCENT
Constant for
DOM_VK_PERCENT . |
static int |
DOM_VK_PERIOD
Constant for
DOM_VK_PERIOD . |
static int |
DOM_VK_PIPE
Constant for
DOM_VK_PIPE . |
static int |
DOM_VK_PLAY
Constant for
DOM_VK_PLAY . |
static int |
DOM_VK_PLUS
Constant for
DOM_VK_PLUS . |
static int |
DOM_VK_PRINT
Constant for
DOM_VK_PRINT . |
static int |
DOM_VK_PRINTSCREEN
Constant for
DOM_VK_PRINTSCREEN . |
static int |
DOM_VK_PROCESSKEY
Constant for
DOM_VK_PROCESSKEY . |
static int |
DOM_VK_Q
Constant for
DOM_VK_Q . |
static int |
DOM_VK_QUESTION_MARK
Constant for
DOM_VK_QUESTION_MARK . |
static int |
DOM_VK_QUOTE
Constant for
DOM_VK_QUOTE . |
static int |
DOM_VK_R
Constant for
DOM_VK_R . |
static int |
DOM_VK_RETURN
Constant for
DOM_VK_RETURN . |
static int |
DOM_VK_RIGHT
Constant for
DOM_VK_RIGHT . |
static int |
DOM_VK_S
Constant for
DOM_VK_S . |
static int |
DOM_VK_SCROLL_LOCK
Constant for
DOM_VK_SCROLL_LOCK . |
static int |
DOM_VK_SELECT
Constant for
DOM_VK_SELECT . |
static int |
DOM_VK_SEMICOLON
Constant for
DOM_VK_SEMICOLON . |
static int |
DOM_VK_SEPARATOR
Constant for
DOM_VK_SEPARATOR . |
static int |
DOM_VK_SHIFT
Constant for
DOM_VK_SHIFT . |
static int |
DOM_VK_SLASH
Constant for
DOM_VK_SLASH . |
static int |
DOM_VK_SLEEP
Constant for
DOM_VK_SLEEP . |
static int |
DOM_VK_SPACE
Constant for
DOM_VK_SPACE . |
static int |
DOM_VK_SUBTRACT
Constant for
DOM_VK_SUBTRACT . |
static int |
DOM_VK_T
Constant for
DOM_VK_T . |
static int |
DOM_VK_TAB
Constant for
DOM_VK_TAB . |
static int |
DOM_VK_TILDE
Constant for
DOM_VK_TILDE . |
static int |
DOM_VK_U
Constant for
DOM_VK_U . |
static int |
DOM_VK_UNDERSCORE
Constant for
DOM_VK_UNDERSCORE . |
static int |
DOM_VK_UP
Constant for
DOM_VK_UP . |
static int |
DOM_VK_V
Constant for
DOM_VK_V . |
static int |
DOM_VK_VOLUME_DOWN
Constant for
DOM_VK_VOLUME_DOWN . |
static int |
DOM_VK_VOLUME_MUTE
Constant for
DOM_VK_VOLUME_MUTE . |
static int |
DOM_VK_VOLUME_UP
Constant for
DOM_VK_VOLUME_UP . |
static int |
DOM_VK_W
Constant for
DOM_VK_W . |
static int |
DOM_VK_WIN
Constant for
DOM_VK_WIN . |
static int |
DOM_VK_WIN_ICO_00
Constant for
DOM_VK_WIN_ICO_00 . |
static int |
DOM_VK_WIN_ICO_CLEAR
Constant for
DOM_VK_WIN_ICO_CLEAR . |
static int |
DOM_VK_WIN_ICO_HELP
Constant for
DOM_VK_WIN_ICO_HELP . |
static int |
DOM_VK_WIN_OEM_ATTN
Constant for
DOM_VK_WIN_OEM_ATTN . |
static int |
DOM_VK_WIN_OEM_AUTO
Constant for
DOM_VK_WIN_OEM_AUTO . |
static int |
DOM_VK_WIN_OEM_BACKTAB
Constant for
DOM_VK_WIN_OEM_BACKTAB . |
static int |
DOM_VK_WIN_OEM_CLEAR
Constant for
DOM_VK_WIN_OEM_CLEAR . |
static int |
DOM_VK_WIN_OEM_COPY
Constant for
DOM_VK_WIN_OEM_COPY . |
static int |
DOM_VK_WIN_OEM_CUSEL
Constant for
DOM_VK_WIN_OEM_CUSEL . |
static int |
DOM_VK_WIN_OEM_ENLW
Constant for
DOM_VK_WIN_OEM_ENLW . |
static int |
DOM_VK_WIN_OEM_FINISH
Constant for
DOM_VK_WIN_OEM_FINISH . |
static int |
DOM_VK_WIN_OEM_FJ_JISHO
Constant for
DOM_VK_WIN_OEM_FJ_JISHO . |
static int |
DOM_VK_WIN_OEM_FJ_LOYA
Constant for
DOM_VK_WIN_OEM_FJ_LOYA . |
static int |
DOM_VK_WIN_OEM_FJ_MASSHOU
Constant for
DOM_VK_WIN_OEM_FJ_MASSHOU . |
static int |
DOM_VK_WIN_OEM_FJ_ROYA
Constant for
DOM_VK_WIN_OEM_FJ_ROYA . |
static int |
DOM_VK_WIN_OEM_FJ_TOUROKU
Constant for
DOM_VK_WIN_OEM_FJ_TOUROKU . |
static int |
DOM_VK_WIN_OEM_JUMP
Constant for
DOM_VK_WIN_OEM_JUMP . |
static int |
DOM_VK_WIN_OEM_PA1
Constant for
DOM_VK_WIN_OEM_PA1 . |
static int |
DOM_VK_WIN_OEM_PA2
Constant for
DOM_VK_WIN_OEM_PA2 . |
static int |
DOM_VK_WIN_OEM_PA3
Constant for
DOM_VK_WIN_OEM_PA3 . |
static int |
DOM_VK_WIN_OEM_RESET
Constant for
DOM_VK_WIN_OEM_RESET . |
static int |
DOM_VK_WIN_OEM_WSCTRL
Constant for
DOM_VK_WIN_OEM_WSCTRL . |
static int |
DOM_VK_X
Constant for
DOM_VK_X . |
static int |
DOM_VK_Y
Constant for
DOM_VK_Y . |
static int |
DOM_VK_Z
Constant for
DOM_VK_Z . |
static int |
DOM_VK_ZOOM
Constant for
DOM_VK_ZOOM . |
SCROLL_PAGE_DOWN, SCROLL_PAGE_UP
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
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
NOT_FOUND
Constructor and Description |
---|
KeyboardEvent()
Creates 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.
|
Modifier and Type | Method and Description |
---|---|
int |
getCharCode()
Returns the char code associated with the event.
|
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.
|
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(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 whether
ALT has been pressed during this event or not. |
boolean |
isCtrlKey()
Returns whether
CTRL 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 whether
SHIFT has been pressed during this event or not. |
static boolean |
isShiftNeeded(char ch,
boolean shiftKey)
Returns whether the specified character can be written only when
SHIFT 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 |
setCode(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(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.
|
getDetail, getView, initUIEvent, setDetail
createPropertyChangeEvent, endFire, eventCreated, getComposed, getCurrentTarget, getEventPhase, getPropertyName, getReturnValue, getSrcElement, getTarget, getTimeStamp, getType, 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
clone, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getWindow, getWindow, getWindowFromTopCallScope, getWithPreemption, has, hasInstance, initParentScope, makeScriptableFor, put, setClassName, setDomNode, setDomNode, setParentScope, setupPromise, setupRejectedPromise
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, 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
public static final int DOM_KEY_LOCATION_STANDARD
DOM_KEY_LOCATION_STANDARD
.public static final int DOM_KEY_LOCATION_LEFT
DOM_KEY_LOCATION_LEFT
.public static final int DOM_KEY_LOCATION_RIGHT
DOM_KEY_LOCATION_RIGHT
.public static final int DOM_KEY_LOCATION_NUMPAD
DOM_KEY_LOCATION_NUMPAD
.public static final int DOM_VK_CANCEL
DOM_VK_CANCEL
.public static final int DOM_VK_HELP
DOM_VK_HELP
.public static final int DOM_VK_TAB
DOM_VK_TAB
.public static final int DOM_VK_CLEAR
DOM_VK_CLEAR
.public static final int DOM_VK_RETURN
DOM_VK_RETURN
.public static final int DOM_VK_SHIFT
DOM_VK_SHIFT
.public static final int DOM_VK_CONTROL
DOM_VK_CONTROL
.public static final int DOM_VK_ALT
DOM_VK_ALT
.public static final int DOM_VK_PAUSE
DOM_VK_PAUSE
.public static final int DOM_VK_CAPS_LOCK
DOM_VK_CAPS_LOCK
.public static final int DOM_VK_HANGUL
DOM_VK_HANGUL
.public static final int DOM_VK_KANA
DOM_VK_KANA
.public static final int DOM_VK_EISU
DOM_VK_EISU
.public static final int DOM_VK_FINAL
DOM_VK_FINAL
.public static final int DOM_VK_JUNJA
DOM_VK_JUNJA
.public static final int DOM_VK_HANJA
DOM_VK_HANJA
.public static final int DOM_VK_KANJI
DOM_VK_KANJI
.public static final int DOM_VK_ESCAPE
DOM_VK_ESCAPE
.public static final int DOM_VK_CONVERT
DOM_VK_CONVERT
.public static final int DOM_VK_NONCONVERT
DOM_VK_NONCONVERT
.public static final int DOM_VK_ACCEPT
DOM_VK_ACCEPT
.public static final int DOM_VK_MODECHANGE
DOM_VK_MODECHANGE
.public static final int DOM_VK_SPACE
DOM_VK_SPACE
.public static final int DOM_VK_PAGE_UP
DOM_VK_PAGE_UP
.public static final int DOM_VK_PAGE_DOWN
DOM_VK_PAGE_DOWN
.public static final int DOM_VK_END
DOM_VK_END
.public static final int DOM_VK_HOME
DOM_VK_HOME
.public static final int DOM_VK_LEFT
DOM_VK_LEFT
.public static final int DOM_VK_UP
DOM_VK_UP
.public static final int DOM_VK_RIGHT
DOM_VK_RIGHT
.public static final int DOM_VK_SELECT
DOM_VK_SELECT
.public static final int DOM_VK_DOWN
DOM_VK_DOWN
.public static final int DOM_VK_PRINT
DOM_VK_PRINT
.public static final int DOM_VK_EXECUTE
DOM_VK_EXECUTE
.public static final int DOM_VK_PRINTSCREEN
DOM_VK_PRINTSCREEN
.public static final int DOM_VK_INSERT
DOM_VK_INSERT
.public static final int DOM_VK_DELETE
DOM_VK_DELETE
.public static final int DOM_VK_0
DOM_VK_0
.public static final int DOM_VK_1
DOM_VK_1
.public static final int DOM_VK_2
DOM_VK_2
.public static final int DOM_VK_3
DOM_VK_3
.public static final int DOM_VK_4
DOM_VK_4
.public static final int DOM_VK_5
DOM_VK_5
.public static final int DOM_VK_6
DOM_VK_6
.public static final int DOM_VK_7
DOM_VK_7
.public static final int DOM_VK_8
DOM_VK_8
.public static final int DOM_VK_9
DOM_VK_9
.public static final int DOM_VK_COLON
DOM_VK_COLON
.public static final int DOM_VK_SEMICOLON
DOM_VK_SEMICOLON
.public static final int DOM_VK_LESS_THAN
DOM_VK_LESS_THAN
.public static final int DOM_VK_EQUALS
DOM_VK_EQUALS
.public static final int DOM_VK_GREATER_THAN
DOM_VK_GREATER_THAN
.public static final int DOM_VK_QUESTION_MARK
DOM_VK_QUESTION_MARK
.public static final int DOM_VK_AT
DOM_VK_AT
.public static final int DOM_VK_A
DOM_VK_A
.public static final int DOM_VK_B
DOM_VK_B
.public static final int DOM_VK_C
DOM_VK_C
.public static final int DOM_VK_D
DOM_VK_D
.public static final int DOM_VK_E
DOM_VK_E
.public static final int DOM_VK_F
DOM_VK_F
.public static final int DOM_VK_G
DOM_VK_G
.public static final int DOM_VK_H
DOM_VK_H
.public static final int DOM_VK_I
DOM_VK_I
.public static final int DOM_VK_J
DOM_VK_J
.public static final int DOM_VK_K
DOM_VK_K
.public static final int DOM_VK_L
DOM_VK_L
.public static final int DOM_VK_M
DOM_VK_M
.public static final int DOM_VK_N
DOM_VK_N
.public static final int DOM_VK_O
DOM_VK_O
.public static final int DOM_VK_BACK_SPACE
DOM_VK_BACK_SPACE
.public static final int DOM_VK_P
DOM_VK_P
.public static final int DOM_VK_Q
DOM_VK_Q
.public static final int DOM_VK_R
DOM_VK_R
.public static final int DOM_VK_S
DOM_VK_S
.public static final int DOM_VK_T
DOM_VK_T
.public static final int DOM_VK_U
DOM_VK_U
.public static final int DOM_VK_V
DOM_VK_V
.public static final int DOM_VK_W
DOM_VK_W
.public static final int DOM_VK_X
DOM_VK_X
.public static final int DOM_VK_Y
DOM_VK_Y
.public static final int DOM_VK_Z
DOM_VK_Z
.public static final int DOM_VK_WIN
DOM_VK_WIN
.public static final int DOM_VK_CONTEXT_MENU
DOM_VK_CONTEXT_MENU
.public static final int DOM_VK_SLEEP
DOM_VK_SLEEP
.public static final int DOM_VK_NUMPAD0
DOM_VK_NUMPAD0
.public static final int DOM_VK_NUMPAD1
DOM_VK_NUMPAD1
.public static final int DOM_VK_NUMPAD2
DOM_VK_NUMPAD2
.public static final int DOM_VK_NUMPAD3
DOM_VK_NUMPAD3
.public static final int DOM_VK_NUMPAD4
DOM_VK_NUMPAD4
.public static final int DOM_VK_NUMPAD5
DOM_VK_NUMPAD5
.public static final int DOM_VK_NUMPAD6
DOM_VK_NUMPAD6
.public static final int DOM_VK_NUMPAD7
DOM_VK_NUMPAD7
.public static final int DOM_VK_NUMPAD8
DOM_VK_NUMPAD8
.public static final int DOM_VK_NUMPAD9
DOM_VK_NUMPAD9
.public static final int DOM_VK_MULTIPLY
DOM_VK_MULTIPLY
.public static final int DOM_VK_ADD
DOM_VK_ADD
.public static final int DOM_VK_SEPARATOR
DOM_VK_SEPARATOR
.public static final int DOM_VK_SUBTRACT
DOM_VK_SUBTRACT
.public static final int DOM_VK_DECIMAL
DOM_VK_DECIMAL
.public static final int DOM_VK_DIVIDE
DOM_VK_DIVIDE
.public static final int DOM_VK_F1
DOM_VK_F1
.public static final int DOM_VK_F2
DOM_VK_F2
.public static final int DOM_VK_F3
DOM_VK_F3
.public static final int DOM_VK_F4
DOM_VK_F4
.public static final int DOM_VK_F5
DOM_VK_F5
.public static final int DOM_VK_F6
DOM_VK_F6
.public static final int DOM_VK_F7
DOM_VK_F7
.public static final int DOM_VK_F8
DOM_VK_F8
.public static final int DOM_VK_F9
DOM_VK_F9
.public static final int DOM_VK_F10
DOM_VK_F10
.public static final int DOM_VK_F11
DOM_VK_F11
.public static final int DOM_VK_F12
DOM_VK_F12
.public static final int DOM_VK_F13
DOM_VK_F13
.public static final int DOM_VK_F14
DOM_VK_F14
.public static final int DOM_VK_F15
DOM_VK_F15
.public static final int DOM_VK_F16
DOM_VK_F16
.public static final int DOM_VK_F17
DOM_VK_F17
.public static final int DOM_VK_F18
DOM_VK_F18
.public static final int DOM_VK_F19
DOM_VK_F19
.public static final int DOM_VK_F20
DOM_VK_F20
.public static final int DOM_VK_F21
DOM_VK_F21
.public static final int DOM_VK_F22
DOM_VK_F22
.public static final int DOM_VK_F23
DOM_VK_F23
.public static final int DOM_VK_F24
DOM_VK_F24
.public static final int DOM_VK_NUM_LOCK
DOM_VK_NUM_LOCK
.public static final int DOM_VK_SCROLL_LOCK
DOM_VK_SCROLL_LOCK
.public static final int DOM_VK_WIN_OEM_FJ_JISHO
DOM_VK_WIN_OEM_FJ_JISHO
.public static final int DOM_VK_WIN_OEM_FJ_MASSHOU
DOM_VK_WIN_OEM_FJ_MASSHOU
.public static final int DOM_VK_WIN_OEM_FJ_TOUROKU
DOM_VK_WIN_OEM_FJ_TOUROKU
.public static final int DOM_VK_WIN_OEM_FJ_LOYA
DOM_VK_WIN_OEM_FJ_LOYA
.public static final int DOM_VK_WIN_OEM_FJ_ROYA
DOM_VK_WIN_OEM_FJ_ROYA
.public static final int DOM_VK_CIRCUMFLEX
DOM_VK_CIRCUMFLEX
.public static final int DOM_VK_EXCLAMATION
DOM_VK_EXCLAMATION
.public static final int DOM_VK_DOUBLE_QUOTE
DOM_VK_DOUBLE_QUOTE
.public static final int DOM_VK_HASH
DOM_VK_HASH
.public static final int DOM_VK_DOLLAR
DOM_VK_DOLLAR
.public static final int DOM_VK_PERCENT
DOM_VK_PERCENT
.public static final int DOM_VK_AMPERSAND
DOM_VK_AMPERSAND
.public static final int DOM_VK_UNDERSCORE
DOM_VK_UNDERSCORE
.public static final int DOM_VK_OPEN_PAREN
DOM_VK_OPEN_PAREN
.public static final int DOM_VK_CLOSE_PAREN
DOM_VK_CLOSE_PAREN
.public static final int DOM_VK_ASTERISK
DOM_VK_ASTERISK
.public static final int DOM_VK_PLUS
DOM_VK_PLUS
.public static final int DOM_VK_PIPE
DOM_VK_PIPE
.public static final int DOM_VK_HYPHEN_MINUS
DOM_VK_HYPHEN_MINUS
.public static final int DOM_VK_OPEN_CURLY_BRACKET
DOM_VK_OPEN_CURLY_BRACKET
.public static final int DOM_VK_CLOSE_CURLY_BRACKET
DOM_VK_CLOSE_CURLY_BRACKET
.public static final int DOM_VK_TILDE
DOM_VK_TILDE
.public static final int DOM_VK_VOLUME_MUTE
DOM_VK_VOLUME_MUTE
.public static final int DOM_VK_VOLUME_DOWN
DOM_VK_VOLUME_DOWN
.public static final int DOM_VK_VOLUME_UP
DOM_VK_VOLUME_UP
.public static final int DOM_VK_COMMA
DOM_VK_COMMA
.public static final int DOM_VK_PERIOD
DOM_VK_PERIOD
.public static final int DOM_VK_SLASH
DOM_VK_SLASH
.public static final int DOM_VK_BACK_QUOTE
DOM_VK_BACK_QUOTE
.public static final int DOM_VK_OPEN_BRACKET
DOM_VK_OPEN_BRACKET
.public static final int DOM_VK_BACK_SLASH
DOM_VK_BACK_SLASH
.public static final int DOM_VK_CLOSE_BRACKET
DOM_VK_CLOSE_BRACKET
.public static final int DOM_VK_QUOTE
DOM_VK_QUOTE
.public static final int DOM_VK_META
DOM_VK_META
.public static final int DOM_VK_ALTGR
DOM_VK_ALTGR
.public static final int DOM_VK_WIN_ICO_HELP
DOM_VK_WIN_ICO_HELP
.public static final int DOM_VK_WIN_ICO_00
DOM_VK_WIN_ICO_00
.public static final int DOM_VK_PROCESSKEY
DOM_VK_PROCESSKEY
.public static final int DOM_VK_WIN_ICO_CLEAR
DOM_VK_WIN_ICO_CLEAR
.public static final int DOM_VK_WIN_OEM_RESET
DOM_VK_WIN_OEM_RESET
.public static final int DOM_VK_WIN_OEM_JUMP
DOM_VK_WIN_OEM_JUMP
.public static final int DOM_VK_WIN_OEM_PA1
DOM_VK_WIN_OEM_PA1
.public static final int DOM_VK_WIN_OEM_PA2
DOM_VK_WIN_OEM_PA2
.public static final int DOM_VK_WIN_OEM_PA3
DOM_VK_WIN_OEM_PA3
.public static final int DOM_VK_WIN_OEM_WSCTRL
DOM_VK_WIN_OEM_WSCTRL
.public static final int DOM_VK_WIN_OEM_CUSEL
DOM_VK_WIN_OEM_CUSEL
.public static final int DOM_VK_WIN_OEM_ATTN
DOM_VK_WIN_OEM_ATTN
.public static final int DOM_VK_WIN_OEM_FINISH
DOM_VK_WIN_OEM_FINISH
.public static final int DOM_VK_WIN_OEM_COPY
DOM_VK_WIN_OEM_COPY
.public static final int DOM_VK_WIN_OEM_AUTO
DOM_VK_WIN_OEM_AUTO
.public static final int DOM_VK_WIN_OEM_ENLW
DOM_VK_WIN_OEM_ENLW
.public static final int DOM_VK_WIN_OEM_BACKTAB
DOM_VK_WIN_OEM_BACKTAB
.public static final int DOM_VK_ATTN
DOM_VK_ATTN
.public static final int DOM_VK_CRSEL
DOM_VK_CRSEL
.public static final int DOM_VK_EXSEL
DOM_VK_EXSEL
.public static final int DOM_VK_EREOF
DOM_VK_EREOF
.public static final int DOM_VK_PLAY
DOM_VK_PLAY
.public static final int DOM_VK_ZOOM
DOM_VK_ZOOM
.public static final int DOM_VK_PA1
DOM_VK_PA1
.public static final int DOM_VK_WIN_OEM_CLEAR
DOM_VK_WIN_OEM_CLEAR
.public KeyboardEvent()
public KeyboardEvent(DomNode domNode, String type, char character, boolean shiftKey, boolean ctrlKey, boolean altKey)
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 pressedpublic KeyboardEvent(DomNode domNode, String type, int keyCode, boolean shiftKey, boolean ctrlKey, boolean altKey)
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 pressedpublic static boolean isShiftNeeded(char ch, boolean shiftKey)
SHIFT
key is pressed.ch
- the charactershiftKey
- is shift key pressedSHIFT
key is pressedpublic void jsConstructor(String type, org.htmlunit.corejs.javascript.ScriptableObject details)
jsConstructor
in class UIEvent
type
- the event typedetails
- the event details (optional)public void initKeyboardEvent(String type, boolean bubbles, boolean cancelable, Object view, String key, int location, boolean ctrlKey, boolean altKey, boolean shiftKey, boolean metaKey)
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 pressedpublic int getCharCode()
protected void setCharCode(int charCode)
charCode
- the char code associated with the eventpublic int getWhich()
protected void setWhich(int which)
which
- the numeric keyCode of the key pressed, or the charCode for an alphanumeric key pressedpublic int getKeyCode()
getKeyCode
in class Event
public boolean isShiftKey()
SHIFT
has been pressed during this event or not.isShiftKey
in class Event
SHIFT
has been pressed during this event or notpublic boolean isCtrlKey()
CTRL
has been pressed during this event or not.public boolean isAltKey()
ALT
has been pressed during this event or not.public String getKey()
protected void setKey(String key)
key
- the value of a key or keys pressed by the userpublic String getCode()
protected void setCode(String code)
code
- a physical key on the keyboardpublic boolean getMetaKey()
protected void setMetaKey(boolean metaKey)
metaKey
- whether or not the "meta" was pressed during the event firingpublic int getLocation()
protected void setLocation(int location)
location
- the location of the key on the keyboardpublic boolean isRepeat()
protected void setRepeat(boolean repeat)
repeat
- whether or not the key is being held downpublic boolean getIsComposing()
protected void setIsComposing(boolean isComposing)
isComposing
- whether or not this event is fired while composingCopyright © 2002–2024 Gargoyle Software Inc.. All rights reserved.