Class 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 Detail

      • DOM_KEY_LOCATION_STANDARD

        public static final int DOM_KEY_LOCATION_STANDARD
        Constant for DOM_KEY_LOCATION_STANDARD.
        See Also:
        Constant Field Values
      • DOM_KEY_LOCATION_LEFT

        public static final int DOM_KEY_LOCATION_LEFT
        Constant for DOM_KEY_LOCATION_LEFT.
        See Also:
        Constant Field Values
      • DOM_KEY_LOCATION_RIGHT

        public static final int DOM_KEY_LOCATION_RIGHT
        Constant for DOM_KEY_LOCATION_RIGHT.
        See Also:
        Constant Field Values
      • DOM_KEY_LOCATION_NUMPAD

        public static final int DOM_KEY_LOCATION_NUMPAD
        Constant for DOM_KEY_LOCATION_NUMPAD.
        See Also:
        Constant Field Values
      • DOM_VK_CANCEL

        public static final int DOM_VK_CANCEL
        Constant for DOM_VK_CANCEL.
        See Also:
        Constant Field Values
      • DOM_VK_HELP

        public static final int DOM_VK_HELP
        Constant for DOM_VK_HELP.
        See Also:
        Constant Field Values
      • DOM_VK_TAB

        public static final int DOM_VK_TAB
        Constant for DOM_VK_TAB.
        See Also:
        Constant Field Values
      • DOM_VK_CLEAR

        public static final int DOM_VK_CLEAR
        Constant for DOM_VK_CLEAR.
        See Also:
        Constant Field Values
      • DOM_VK_RETURN

        public static final int DOM_VK_RETURN
        Constant for DOM_VK_RETURN.
        See Also:
        Constant Field Values
      • DOM_VK_SHIFT

        public static final int DOM_VK_SHIFT
        Constant for DOM_VK_SHIFT.
        See Also:
        Constant Field Values
      • DOM_VK_CONTROL

        public static final int DOM_VK_CONTROL
        Constant for DOM_VK_CONTROL.
        See Also:
        Constant Field Values
      • DOM_VK_ALT

        public static final int DOM_VK_ALT
        Constant for DOM_VK_ALT.
        See Also:
        Constant Field Values
      • DOM_VK_PAUSE

        public static final int DOM_VK_PAUSE
        Constant for DOM_VK_PAUSE.
        See Also:
        Constant Field Values
      • DOM_VK_CAPS_LOCK

        public static final int DOM_VK_CAPS_LOCK
        Constant for DOM_VK_CAPS_LOCK.
        See Also:
        Constant Field Values
      • DOM_VK_HANGUL

        public static final int DOM_VK_HANGUL
        Constant for DOM_VK_HANGUL.
        See Also:
        Constant Field Values
      • DOM_VK_KANA

        public static final int DOM_VK_KANA
        Constant for DOM_VK_KANA.
        See Also:
        Constant Field Values
      • DOM_VK_EISU

        public static final int DOM_VK_EISU
        Constant for DOM_VK_EISU.
        See Also:
        Constant Field Values
      • DOM_VK_FINAL

        public static final int DOM_VK_FINAL
        Constant for DOM_VK_FINAL.
        See Also:
        Constant Field Values
      • DOM_VK_JUNJA

        public static final int DOM_VK_JUNJA
        Constant for DOM_VK_JUNJA.
        See Also:
        Constant Field Values
      • DOM_VK_HANJA

        public static final int DOM_VK_HANJA
        Constant for DOM_VK_HANJA.
        See Also:
        Constant Field Values
      • DOM_VK_KANJI

        public static final int DOM_VK_KANJI
        Constant for DOM_VK_KANJI.
        See Also:
        Constant Field Values
      • DOM_VK_ESCAPE

        public static final int DOM_VK_ESCAPE
        Constant for DOM_VK_ESCAPE.
        See Also:
        Constant Field Values
      • DOM_VK_CONVERT

        public static final int DOM_VK_CONVERT
        Constant for DOM_VK_CONVERT.
        See Also:
        Constant Field Values
      • DOM_VK_NONCONVERT

        public static final int DOM_VK_NONCONVERT
        Constant for DOM_VK_NONCONVERT.
        See Also:
        Constant Field Values
      • DOM_VK_ACCEPT

        public static final int DOM_VK_ACCEPT
        Constant for DOM_VK_ACCEPT.
        See Also:
        Constant Field Values
      • DOM_VK_MODECHANGE

        public static final int DOM_VK_MODECHANGE
        Constant for DOM_VK_MODECHANGE.
        See Also:
        Constant Field Values
      • DOM_VK_SPACE

        public static final int DOM_VK_SPACE
        Constant for DOM_VK_SPACE.
        See Also:
        Constant Field Values
      • DOM_VK_PAGE_UP

        public static final int DOM_VK_PAGE_UP
        Constant for DOM_VK_PAGE_UP.
        See Also:
        Constant Field Values
      • DOM_VK_PAGE_DOWN

        public static final int DOM_VK_PAGE_DOWN
        Constant for DOM_VK_PAGE_DOWN.
        See Also:
        Constant Field Values
      • DOM_VK_END

        public static final int DOM_VK_END
        Constant for DOM_VK_END.
        See Also:
        Constant Field Values
      • DOM_VK_HOME

        public static final int DOM_VK_HOME
        Constant for DOM_VK_HOME.
        See Also:
        Constant Field Values
      • DOM_VK_LEFT

        public static final int DOM_VK_LEFT
        Constant for DOM_VK_LEFT.
        See Also:
        Constant Field Values
      • DOM_VK_RIGHT

        public static final int DOM_VK_RIGHT
        Constant for DOM_VK_RIGHT.
        See Also:
        Constant Field Values
      • DOM_VK_SELECT

        public static final int DOM_VK_SELECT
        Constant for DOM_VK_SELECT.
        See Also:
        Constant Field Values
      • DOM_VK_DOWN

        public static final int DOM_VK_DOWN
        Constant for DOM_VK_DOWN.
        See Also:
        Constant Field Values
      • DOM_VK_PRINT

        public static final int DOM_VK_PRINT
        Constant for DOM_VK_PRINT.
        See Also:
        Constant Field Values
      • DOM_VK_EXECUTE

        public static final int DOM_VK_EXECUTE
        Constant for DOM_VK_EXECUTE.
        See Also:
        Constant Field Values
      • DOM_VK_PRINTSCREEN

        public static final int DOM_VK_PRINTSCREEN
        Constant for DOM_VK_PRINTSCREEN.
        See Also:
        Constant Field Values
      • DOM_VK_INSERT

        public static final int DOM_VK_INSERT
        Constant for DOM_VK_INSERT.
        See Also:
        Constant Field Values
      • DOM_VK_DELETE

        public static final int DOM_VK_DELETE
        Constant for DOM_VK_DELETE.
        See Also:
        Constant Field Values
      • DOM_VK_COLON

        public static final int DOM_VK_COLON
        Constant for DOM_VK_COLON.
        See Also:
        Constant Field Values
      • DOM_VK_SEMICOLON

        public static final int DOM_VK_SEMICOLON
        Constant for DOM_VK_SEMICOLON.
        See Also:
        Constant Field Values
      • DOM_VK_LESS_THAN

        public static final int DOM_VK_LESS_THAN
        Constant for DOM_VK_LESS_THAN.
        See Also:
        Constant Field Values
      • DOM_VK_EQUALS

        public static final int DOM_VK_EQUALS
        Constant for DOM_VK_EQUALS.
        See Also:
        Constant Field Values
      • DOM_VK_GREATER_THAN

        public static final int DOM_VK_GREATER_THAN
        Constant for DOM_VK_GREATER_THAN.
        See Also:
        Constant Field Values
      • DOM_VK_QUESTION_MARK

        public static final int DOM_VK_QUESTION_MARK
        Constant for DOM_VK_QUESTION_MARK.
        See Also:
        Constant Field Values
      • DOM_VK_BACK_SPACE

        public static final int DOM_VK_BACK_SPACE
        Constant for DOM_VK_BACK_SPACE.
        See Also:
        Constant Field Values
      • DOM_VK_WIN

        public static final int DOM_VK_WIN
        Constant for DOM_VK_WIN.
        See Also:
        Constant Field Values
      • DOM_VK_CONTEXT_MENU

        public static final int DOM_VK_CONTEXT_MENU
        Constant for DOM_VK_CONTEXT_MENU.
        See Also:
        Constant Field Values
      • DOM_VK_SLEEP

        public static final int DOM_VK_SLEEP
        Constant for DOM_VK_SLEEP.
        See Also:
        Constant Field Values
      • DOM_VK_NUMPAD0

        public static final int DOM_VK_NUMPAD0
        Constant for DOM_VK_NUMPAD0.
        See Also:
        Constant Field Values
      • DOM_VK_NUMPAD1

        public static final int DOM_VK_NUMPAD1
        Constant for DOM_VK_NUMPAD1.
        See Also:
        Constant Field Values
      • DOM_VK_NUMPAD2

        public static final int DOM_VK_NUMPAD2
        Constant for DOM_VK_NUMPAD2.
        See Also:
        Constant Field Values
      • DOM_VK_NUMPAD3

        public static final int DOM_VK_NUMPAD3
        Constant for DOM_VK_NUMPAD3.
        See Also:
        Constant Field Values
      • DOM_VK_NUMPAD4

        public static final int DOM_VK_NUMPAD4
        Constant for DOM_VK_NUMPAD4.
        See Also:
        Constant Field Values
      • DOM_VK_NUMPAD5

        public static final int DOM_VK_NUMPAD5
        Constant for DOM_VK_NUMPAD5.
        See Also:
        Constant Field Values
      • DOM_VK_NUMPAD6

        public static final int DOM_VK_NUMPAD6
        Constant for DOM_VK_NUMPAD6.
        See Also:
        Constant Field Values
      • DOM_VK_NUMPAD7

        public static final int DOM_VK_NUMPAD7
        Constant for DOM_VK_NUMPAD7.
        See Also:
        Constant Field Values
      • DOM_VK_NUMPAD8

        public static final int DOM_VK_NUMPAD8
        Constant for DOM_VK_NUMPAD8.
        See Also:
        Constant Field Values
      • DOM_VK_NUMPAD9

        public static final int DOM_VK_NUMPAD9
        Constant for DOM_VK_NUMPAD9.
        See Also:
        Constant Field Values
      • DOM_VK_MULTIPLY

        public static final int DOM_VK_MULTIPLY
        Constant for DOM_VK_MULTIPLY.
        See Also:
        Constant Field Values
      • DOM_VK_ADD

        public static final int DOM_VK_ADD
        Constant for DOM_VK_ADD.
        See Also:
        Constant Field Values
      • DOM_VK_SEPARATOR

        public static final int DOM_VK_SEPARATOR
        Constant for DOM_VK_SEPARATOR.
        See Also:
        Constant Field Values
      • DOM_VK_SUBTRACT

        public static final int DOM_VK_SUBTRACT
        Constant for DOM_VK_SUBTRACT.
        See Also:
        Constant Field Values
      • DOM_VK_DECIMAL

        public static final int DOM_VK_DECIMAL
        Constant for DOM_VK_DECIMAL.
        See Also:
        Constant Field Values
      • DOM_VK_DIVIDE

        public static final int DOM_VK_DIVIDE
        Constant for DOM_VK_DIVIDE.
        See Also:
        Constant Field Values
      • DOM_VK_F10

        public static final int DOM_VK_F10
        Constant for DOM_VK_F10.
        See Also:
        Constant Field Values
      • DOM_VK_F11

        public static final int DOM_VK_F11
        Constant for DOM_VK_F11.
        See Also:
        Constant Field Values
      • DOM_VK_F12

        public static final int DOM_VK_F12
        Constant for DOM_VK_F12.
        See Also:
        Constant Field Values
      • DOM_VK_F13

        public static final int DOM_VK_F13
        Constant for DOM_VK_F13.
        See Also:
        Constant Field Values
      • DOM_VK_F14

        public static final int DOM_VK_F14
        Constant for DOM_VK_F14.
        See Also:
        Constant Field Values
      • DOM_VK_F15

        public static final int DOM_VK_F15
        Constant for DOM_VK_F15.
        See Also:
        Constant Field Values
      • DOM_VK_F16

        public static final int DOM_VK_F16
        Constant for DOM_VK_F16.
        See Also:
        Constant Field Values
      • DOM_VK_F17

        public static final int DOM_VK_F17
        Constant for DOM_VK_F17.
        See Also:
        Constant Field Values
      • DOM_VK_F18

        public static final int DOM_VK_F18
        Constant for DOM_VK_F18.
        See Also:
        Constant Field Values
      • DOM_VK_F19

        public static final int DOM_VK_F19
        Constant for DOM_VK_F19.
        See Also:
        Constant Field Values
      • DOM_VK_F20

        public static final int DOM_VK_F20
        Constant for DOM_VK_F20.
        See Also:
        Constant Field Values
      • DOM_VK_F21

        public static final int DOM_VK_F21
        Constant for DOM_VK_F21.
        See Also:
        Constant Field Values
      • DOM_VK_F22

        public static final int DOM_VK_F22
        Constant for DOM_VK_F22.
        See Also:
        Constant Field Values
      • DOM_VK_F23

        public static final int DOM_VK_F23
        Constant for DOM_VK_F23.
        See Also:
        Constant Field Values
      • DOM_VK_F24

        public static final int DOM_VK_F24
        Constant for DOM_VK_F24.
        See Also:
        Constant Field Values
      • DOM_VK_NUM_LOCK

        public static final int DOM_VK_NUM_LOCK
        Constant for DOM_VK_NUM_LOCK.
        See Also:
        Constant Field Values
      • DOM_VK_SCROLL_LOCK

        public static final int DOM_VK_SCROLL_LOCK
        Constant for DOM_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 for DOM_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 for DOM_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 for DOM_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 for DOM_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 for DOM_VK_WIN_OEM_FJ_ROYA.
        See Also:
        Constant Field Values
      • DOM_VK_CIRCUMFLEX

        public static final int DOM_VK_CIRCUMFLEX
        Constant for DOM_VK_CIRCUMFLEX.
        See Also:
        Constant Field Values
      • DOM_VK_EXCLAMATION

        public static final int DOM_VK_EXCLAMATION
        Constant for DOM_VK_EXCLAMATION.
        See Also:
        Constant Field Values
      • DOM_VK_DOUBLE_QUOTE

        public static final int DOM_VK_DOUBLE_QUOTE
        Constant for DOM_VK_DOUBLE_QUOTE.
        See Also:
        Constant Field Values
      • DOM_VK_HASH

        public static final int DOM_VK_HASH
        Constant for DOM_VK_HASH.
        See Also:
        Constant Field Values
      • DOM_VK_DOLLAR

        public static final int DOM_VK_DOLLAR
        Constant for DOM_VK_DOLLAR.
        See Also:
        Constant Field Values
      • DOM_VK_PERCENT

        public static final int DOM_VK_PERCENT
        Constant for DOM_VK_PERCENT.
        See Also:
        Constant Field Values
      • DOM_VK_AMPERSAND

        public static final int DOM_VK_AMPERSAND
        Constant for DOM_VK_AMPERSAND.
        See Also:
        Constant Field Values
      • DOM_VK_UNDERSCORE

        public static final int DOM_VK_UNDERSCORE
        Constant for DOM_VK_UNDERSCORE.
        See Also:
        Constant Field Values
      • DOM_VK_OPEN_PAREN

        public static final int DOM_VK_OPEN_PAREN
        Constant for DOM_VK_OPEN_PAREN.
        See Also:
        Constant Field Values
      • DOM_VK_CLOSE_PAREN

        public static final int DOM_VK_CLOSE_PAREN
        Constant for DOM_VK_CLOSE_PAREN.
        See Also:
        Constant Field Values
      • DOM_VK_ASTERISK

        public static final int DOM_VK_ASTERISK
        Constant for DOM_VK_ASTERISK.
        See Also:
        Constant Field Values
      • DOM_VK_PLUS

        public static final int DOM_VK_PLUS
        Constant for DOM_VK_PLUS.
        See Also:
        Constant Field Values
      • DOM_VK_PIPE

        public static final int DOM_VK_PIPE
        Constant for DOM_VK_PIPE.
        See Also:
        Constant Field Values
      • DOM_VK_HYPHEN_MINUS

        public static final int DOM_VK_HYPHEN_MINUS
        Constant for DOM_VK_HYPHEN_MINUS.
        See Also:
        Constant Field Values
      • DOM_VK_OPEN_CURLY_BRACKET

        public static final int DOM_VK_OPEN_CURLY_BRACKET
        Constant for DOM_VK_OPEN_CURLY_BRACKET.
        See Also:
        Constant Field Values
      • DOM_VK_CLOSE_CURLY_BRACKET

        public static final int DOM_VK_CLOSE_CURLY_BRACKET
        Constant for DOM_VK_CLOSE_CURLY_BRACKET.
        See Also:
        Constant Field Values
      • DOM_VK_TILDE

        public static final int DOM_VK_TILDE
        Constant for DOM_VK_TILDE.
        See Also:
        Constant Field Values
      • DOM_VK_VOLUME_MUTE

        public static final int DOM_VK_VOLUME_MUTE
        Constant for DOM_VK_VOLUME_MUTE.
        See Also:
        Constant Field Values
      • DOM_VK_VOLUME_DOWN

        public static final int DOM_VK_VOLUME_DOWN
        Constant for DOM_VK_VOLUME_DOWN.
        See Also:
        Constant Field Values
      • DOM_VK_VOLUME_UP

        public static final int DOM_VK_VOLUME_UP
        Constant for DOM_VK_VOLUME_UP.
        See Also:
        Constant Field Values
      • DOM_VK_COMMA

        public static final int DOM_VK_COMMA
        Constant for DOM_VK_COMMA.
        See Also:
        Constant Field Values
      • DOM_VK_PERIOD

        public static final int DOM_VK_PERIOD
        Constant for DOM_VK_PERIOD.
        See Also:
        Constant Field Values
      • DOM_VK_SLASH

        public static final int DOM_VK_SLASH
        Constant for DOM_VK_SLASH.
        See Also:
        Constant Field Values
      • DOM_VK_BACK_QUOTE

        public static final int DOM_VK_BACK_QUOTE
        Constant for DOM_VK_BACK_QUOTE.
        See Also:
        Constant Field Values
      • DOM_VK_OPEN_BRACKET

        public static final int DOM_VK_OPEN_BRACKET
        Constant for DOM_VK_OPEN_BRACKET.
        See Also:
        Constant Field Values
      • DOM_VK_BACK_SLASH

        public static final int DOM_VK_BACK_SLASH
        Constant for DOM_VK_BACK_SLASH.
        See Also:
        Constant Field Values
      • DOM_VK_CLOSE_BRACKET

        public static final int DOM_VK_CLOSE_BRACKET
        Constant for DOM_VK_CLOSE_BRACKET.
        See Also:
        Constant Field Values
      • DOM_VK_QUOTE

        public static final int DOM_VK_QUOTE
        Constant for DOM_VK_QUOTE.
        See Also:
        Constant Field Values
      • DOM_VK_META

        public static final int DOM_VK_META
        Constant for DOM_VK_META.
        See Also:
        Constant Field Values
      • DOM_VK_ALTGR

        public static final int DOM_VK_ALTGR
        Constant for DOM_VK_ALTGR.
        See Also:
        Constant Field Values
      • DOM_VK_WIN_ICO_HELP

        public static final int DOM_VK_WIN_ICO_HELP
        Constant for DOM_VK_WIN_ICO_HELP.
        See Also:
        Constant Field Values
      • DOM_VK_WIN_ICO_00

        public static final int DOM_VK_WIN_ICO_00
        Constant for DOM_VK_WIN_ICO_00.
        See Also:
        Constant Field Values
      • DOM_VK_PROCESSKEY

        public static final int DOM_VK_PROCESSKEY
        Constant for DOM_VK_PROCESSKEY.
        See Also:
        Constant Field Values
      • DOM_VK_WIN_ICO_CLEAR

        public static final int DOM_VK_WIN_ICO_CLEAR
        Constant for DOM_VK_WIN_ICO_CLEAR.
        See Also:
        Constant Field Values
      • DOM_VK_WIN_OEM_RESET

        public static final int DOM_VK_WIN_OEM_RESET
        Constant for DOM_VK_WIN_OEM_RESET.
        See Also:
        Constant Field Values
      • DOM_VK_WIN_OEM_JUMP

        public static final int DOM_VK_WIN_OEM_JUMP
        Constant for DOM_VK_WIN_OEM_JUMP.
        See Also:
        Constant Field Values
      • DOM_VK_WIN_OEM_PA1

        public static final int DOM_VK_WIN_OEM_PA1
        Constant for DOM_VK_WIN_OEM_PA1.
        See Also:
        Constant Field Values
      • DOM_VK_WIN_OEM_PA2

        public static final int DOM_VK_WIN_OEM_PA2
        Constant for DOM_VK_WIN_OEM_PA2.
        See Also:
        Constant Field Values
      • DOM_VK_WIN_OEM_PA3

        public static final int DOM_VK_WIN_OEM_PA3
        Constant for DOM_VK_WIN_OEM_PA3.
        See Also:
        Constant Field Values
      • DOM_VK_WIN_OEM_WSCTRL

        public static final int DOM_VK_WIN_OEM_WSCTRL
        Constant for DOM_VK_WIN_OEM_WSCTRL.
        See Also:
        Constant Field Values
      • DOM_VK_WIN_OEM_CUSEL

        public static final int DOM_VK_WIN_OEM_CUSEL
        Constant for DOM_VK_WIN_OEM_CUSEL.
        See Also:
        Constant Field Values
      • DOM_VK_WIN_OEM_ATTN

        public static final int DOM_VK_WIN_OEM_ATTN
        Constant for DOM_VK_WIN_OEM_ATTN.
        See Also:
        Constant Field Values
      • DOM_VK_WIN_OEM_FINISH

        public static final int DOM_VK_WIN_OEM_FINISH
        Constant for DOM_VK_WIN_OEM_FINISH.
        See Also:
        Constant Field Values
      • DOM_VK_WIN_OEM_COPY

        public static final int DOM_VK_WIN_OEM_COPY
        Constant for DOM_VK_WIN_OEM_COPY.
        See Also:
        Constant Field Values
      • DOM_VK_WIN_OEM_AUTO

        public static final int DOM_VK_WIN_OEM_AUTO
        Constant for DOM_VK_WIN_OEM_AUTO.
        See Also:
        Constant Field Values
      • DOM_VK_WIN_OEM_ENLW

        public static final int DOM_VK_WIN_OEM_ENLW
        Constant for DOM_VK_WIN_OEM_ENLW.
        See Also:
        Constant Field Values
      • DOM_VK_WIN_OEM_BACKTAB

        public static final int DOM_VK_WIN_OEM_BACKTAB
        Constant for DOM_VK_WIN_OEM_BACKTAB.
        See Also:
        Constant Field Values
      • DOM_VK_ATTN

        public static final int DOM_VK_ATTN
        Constant for DOM_VK_ATTN.
        See Also:
        Constant Field Values
      • DOM_VK_CRSEL

        public static final int DOM_VK_CRSEL
        Constant for DOM_VK_CRSEL.
        See Also:
        Constant Field Values
      • DOM_VK_EXSEL

        public static final int DOM_VK_EXSEL
        Constant for DOM_VK_EXSEL.
        See Also:
        Constant Field Values
      • DOM_VK_EREOF

        public static final int DOM_VK_EREOF
        Constant for DOM_VK_EREOF.
        See Also:
        Constant Field Values
      • DOM_VK_PLAY

        public static final int DOM_VK_PLAY
        Constant for DOM_VK_PLAY.
        See Also:
        Constant Field Values
      • DOM_VK_ZOOM

        public static final int DOM_VK_ZOOM
        Constant for DOM_VK_ZOOM.
        See Also:
        Constant Field Values
      • DOM_VK_PA1

        public static final int DOM_VK_PA1
        Constant for DOM_VK_PA1.
        See Also:
        Constant Field Values
      • DOM_VK_WIN_OEM_CLEAR

        public static final int DOM_VK_WIN_OEM_CLEAR
        Constant for DOM_VK_WIN_OEM_CLEAR.
        See Also:
        Constant Field Values
      • 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 event
        type - the event type
        character - the character associated with the event
        shiftKey - true if SHIFT is pressed
        ctrlKey - true if CTRL is pressed
        altKey - 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 event
        type - the event type
        keyCode - the key code associated with the event
        shiftKey - true if SHIFT is pressed
        ctrlKey - true if CTRL is pressed
        altKey - 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 when SHIFT key is pressed.
        Parameters:
        ch - the character
        shiftKey - 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 class UIEvent
        Parameters:
        type - the event type
        details - 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 type
        bubbles - can the event bubble
        cancelable - can the event be canceled
        view - the view to use for this event
        key - the value of the key attribute. Defaults to ""
        location - the value of the location attribute. Defaults to 0
        ctrlKey - is the control key pressed
        altKey - is the alt key pressed
        shiftKey - is the shift key pressed
        metaKey - 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.
        Overrides:
        getWhich in class UIEvent
        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 class Event
        Returns:
        the key code associated with the event
      • isShiftKey

        public boolean isShiftKey()
        Returns whether SHIFT has been pressed during this event or not.
        Overrides:
        isShiftKey in class Event
        Returns:
        whether SHIFT has been pressed during this event or not
      • isCtrlKey

        public boolean isCtrlKey()
        Returns whether CTRL has been pressed during this event or not.
        Overrides:
        isCtrlKey in class Event
        Returns:
        whether CTRL has been pressed during this event or not
      • isAltKey

        public boolean isAltKey()
        Returns whether ALT has been pressed during this event or not.
        Overrides:
        isAltKey in class Event
        Returns:
        whether ALT 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