Class KeyboardEvent

java.lang.Object
org.htmlunit.corejs.javascript.ScriptableObject
All Implemented Interfaces:
Serializable, Cloneable, org.htmlunit.corejs.javascript.ConstProperties, org.htmlunit.corejs.javascript.debug.DebuggableObject, org.htmlunit.corejs.javascript.Scriptable, org.htmlunit.corejs.javascript.SymbolScriptable

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:
  • Field Details

    • DOM_KEY_LOCATION_STANDARD

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static final int DOM_VK_LEFT
      Constant for DOM_VK_LEFT.
      See Also:
    • DOM_VK_UP

      public static final int DOM_VK_UP
      Constant for DOM_VK_UP.
      See Also:
    • DOM_VK_RIGHT

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

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

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

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

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

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

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

      public static final int DOM_VK_DELETE
      Constant for DOM_VK_DELETE.
      See Also:
    • DOM_VK_0

      public static final int DOM_VK_0
      Constant for DOM_VK_0.
      See Also:
    • DOM_VK_1

      public static final int DOM_VK_1
      Constant for DOM_VK_1.
      See Also:
    • DOM_VK_2

      public static final int DOM_VK_2
      Constant for DOM_VK_2.
      See Also:
    • DOM_VK_3

      public static final int DOM_VK_3
      Constant for DOM_VK_3.
      See Also:
    • DOM_VK_4

      public static final int DOM_VK_4
      Constant for DOM_VK_4.
      See Also:
    • DOM_VK_5

      public static final int DOM_VK_5
      Constant for DOM_VK_5.
      See Also:
    • DOM_VK_6

      public static final int DOM_VK_6
      Constant for DOM_VK_6.
      See Also:
    • DOM_VK_7

      public static final int DOM_VK_7
      Constant for DOM_VK_7.
      See Also:
    • DOM_VK_8

      public static final int DOM_VK_8
      Constant for DOM_VK_8.
      See Also:
    • DOM_VK_9

      public static final int DOM_VK_9
      Constant for DOM_VK_9.
      See Also:
    • DOM_VK_COLON

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

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

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

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

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

      public static final int DOM_VK_QUESTION_MARK
      Constant for DOM_VK_QUESTION_MARK.
      See Also:
    • DOM_VK_AT

      public static final int DOM_VK_AT
      Constant for DOM_VK_AT.
      See Also:
    • DOM_VK_A

      public static final int DOM_VK_A
      Constant for DOM_VK_A.
      See Also:
    • DOM_VK_B

      public static final int DOM_VK_B
      Constant for DOM_VK_B.
      See Also:
    • DOM_VK_C

      public static final int DOM_VK_C
      Constant for DOM_VK_C.
      See Also:
    • DOM_VK_D

      public static final int DOM_VK_D
      Constant for DOM_VK_D.
      See Also:
    • DOM_VK_E

      public static final int DOM_VK_E
      Constant for DOM_VK_E.
      See Also:
    • DOM_VK_F

      public static final int DOM_VK_F
      Constant for DOM_VK_F.
      See Also:
    • DOM_VK_G

      public static final int DOM_VK_G
      Constant for DOM_VK_G.
      See Also:
    • DOM_VK_H

      public static final int DOM_VK_H
      Constant for DOM_VK_H.
      See Also:
    • DOM_VK_I

      public static final int DOM_VK_I
      Constant for DOM_VK_I.
      See Also:
    • DOM_VK_J

      public static final int DOM_VK_J
      Constant for DOM_VK_J.
      See Also:
    • DOM_VK_K

      public static final int DOM_VK_K
      Constant for DOM_VK_K.
      See Also:
    • DOM_VK_L

      public static final int DOM_VK_L
      Constant for DOM_VK_L.
      See Also:
    • DOM_VK_M

      public static final int DOM_VK_M
      Constant for DOM_VK_M.
      See Also:
    • DOM_VK_N

      public static final int DOM_VK_N
      Constant for DOM_VK_N.
      See Also:
    • DOM_VK_O

      public static final int DOM_VK_O
      Constant for DOM_VK_O.
      See Also:
    • DOM_VK_BACK_SPACE

      public static final int DOM_VK_BACK_SPACE
      Constant for DOM_VK_BACK_SPACE.
      See Also:
    • DOM_VK_P

      public static final int DOM_VK_P
      Constant for DOM_VK_P.
      See Also:
    • DOM_VK_Q

      public static final int DOM_VK_Q
      Constant for DOM_VK_Q.
      See Also:
    • DOM_VK_R

      public static final int DOM_VK_R
      Constant for DOM_VK_R.
      See Also:
    • DOM_VK_S

      public static final int DOM_VK_S
      Constant for DOM_VK_S.
      See Also:
    • DOM_VK_T

      public static final int DOM_VK_T
      Constant for DOM_VK_T.
      See Also:
    • DOM_VK_U

      public static final int DOM_VK_U
      Constant for DOM_VK_U.
      See Also:
    • DOM_VK_V

      public static final int DOM_VK_V
      Constant for DOM_VK_V.
      See Also:
    • DOM_VK_W

      public static final int DOM_VK_W
      Constant for DOM_VK_W.
      See Also:
    • DOM_VK_X

      public static final int DOM_VK_X
      Constant for DOM_VK_X.
      See Also:
    • DOM_VK_Y

      public static final int DOM_VK_Y
      Constant for DOM_VK_Y.
      See Also:
    • DOM_VK_Z

      public static final int DOM_VK_Z
      Constant for DOM_VK_Z.
      See Also:
    • DOM_VK_WIN

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static final int DOM_VK_DIVIDE
      Constant for DOM_VK_DIVIDE.
      See Also:
    • DOM_VK_F1

      public static final int DOM_VK_F1
      Constant for DOM_VK_F1.
      See Also:
    • DOM_VK_F2

      public static final int DOM_VK_F2
      Constant for DOM_VK_F2.
      See Also:
    • DOM_VK_F3

      public static final int DOM_VK_F3
      Constant for DOM_VK_F3.
      See Also:
    • DOM_VK_F4

      public static final int DOM_VK_F4
      Constant for DOM_VK_F4.
      See Also:
    • DOM_VK_F5

      public static final int DOM_VK_F5
      Constant for DOM_VK_F5.
      See Also:
    • DOM_VK_F6

      public static final int DOM_VK_F6
      Constant for DOM_VK_F6.
      See Also:
    • DOM_VK_F7

      public static final int DOM_VK_F7
      Constant for DOM_VK_F7.
      See Also:
    • DOM_VK_F8

      public static final int DOM_VK_F8
      Constant for DOM_VK_F8.
      See Also:
    • DOM_VK_F9

      public static final int DOM_VK_F9
      Constant for DOM_VK_F9.
      See Also:
    • DOM_VK_F10

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static final int DOM_VK_WIN_OEM_CLEAR
      Constant for DOM_VK_WIN_OEM_CLEAR.
      See Also:
    • keyCodeMap

      private static final Map<Character,Integer> keyCodeMap
      For Event.TYPE_KEY_DOWN and Event.TYPE_KEY_UP, this map stores Event.setKeyCode(int) associated with the character (if they are not the same). You can verify this here
    • key_

      private String key_
      The key value of the key represented by the event.
    • code_

      private 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 Details

    • KeyboardEvent

      public KeyboardEvent()
      Creates a new keyboard event instance.
    • KeyboardEvent

      public KeyboardEvent(DomNode domNode, String type, char character, boolean shiftKey, boolean ctrlKey, boolean altKey)
      Creates a new keyboard event instance.
      Parameters:
      domNode - the DOM node that triggered the 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, 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 Details

    • 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:
    • determineKey

      private String determineKey()
      Determines the value of the 'key' property from the current value of 'keyCode', 'charCode', or 'which'.
      Returns:
      the key value
    • determineCode

      private 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(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(String type, boolean bubbles, boolean cancelable, Object view, String key, int location, boolean ctrlKey, boolean altKey, boolean shiftKey, boolean metaKey)
      Implementation of the DOM Level 3 Event method for initializing the key event.
      Parameters:
      type - the event 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 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(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 String getCode()
      Returns a physical key on the keyboard.
      Returns:
      a physical key on the keyboard
    • setCode

      protected void setCode(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