Class KeyboardEventInit

    • Constructor Detail

      • KeyboardEventInit

        public KeyboardEventInit()
        Creates an empty object
      • KeyboardEventInit

        public KeyboardEventInit​(String key)
        Creates an initialization object, setting the keyboard key value.
        Parameters:
        key - keyboard key initialization property.
      • KeyboardEventInit

        public KeyboardEventInit​(NativeKeyboardEvent source)
        Creates an initialization object, cloning all source event data
        Parameters:
        source - source event to clone.
    • Method Detail

      • getModifiersHandler

        public org.pepstock.charba.client.dom.events.ModifiersHandler getModifiersHandler()
      • getKey

        public String getKey()
        Returns a string, defaulting to "", that sets the value of NativeKeyboardEvent key, the value of the key pressed by the user.
        Returns:
        a string, defaulting to "", that sets the value of NativeKeyboardEvent key, the value of the key pressed by the user
      • setKey

        public void setKey​(String key)
        Sets a string that sets the value of NativeKeyboardEvent key, the value of the key pressed by the user
        Parameters:
        key - a string that sets the value of NativeKeyboardEvent key, the value of the key pressed by the user
      • getCode

        public String getCode()
        Returns a string, defaulting to "", that sets the value of NativeKeyboardEvent code, represents a physical key on the keyboard (as opposed to the character generated by pressing the key).
        Returns:
        a string, defaulting to "", that sets the value of NativeKeyboardEvent code, represents a physical key on the keyboard (as opposed to the character generated by pressing the key)
      • setCode

        public void setCode​(String code)
        Sets a string that sets the value of NativeKeyboardEvent code, represents a physical key on the keyboard (as opposed to the character generated by pressing the key).
        Parameters:
        code - a string that sets the value of NativeKeyboardEvent code, represents a physical key on the keyboard (as opposed to the character generated by pressing the key)
      • getLocation

        public KeyboardLocation getLocation()
        Returns the location of the key on the keyboard or other input device.
        Returns:
        the location of the key on the keyboard or other input device
      • setLocation

        public void setLocation​(KeyboardLocation location)
        Sets the location of the key on the keyboard or other input device.
        Parameters:
        location - the location of the key on the keyboard or other input device
      • isRepeat

        public boolean isRepeat()
        Returns a boolean value that is true if the given key is being held down such that it is automatically repeating.
        Returns:
        a boolean value that is true if the given key is being held down such that it is automatically repeating
      • setRepeat

        public void setRepeat​(boolean repeat)
        Sets a boolean value that is true if the given key is being held down such that it is automatically repeating.
        Parameters:
        repeat - a boolean value that is true if the given key is being held down such that it is automatically repeating
      • isAltKey

        public default boolean isAltKey()
        Returns true if the alt key was down when the mouse event was fired.
        Returns:
        true if the alt key was down when the mouse event was fired
      • setAltKey

        public default void setAltKey​(boolean alt)
        Sets true if the alt key was down when the mouse event was fired.
        Parameters:
        alt - true if the alt key was down when the mouse event was fired
      • isCtrlKey

        public default boolean isCtrlKey()
        Returns true if the control key was down when the mouse event was fired.
        Returns:
        true if the control key was down when the mouse event was fired
      • setCtrlKey

        public default void setCtrlKey​(boolean ctrl)
        Sets true if the control key was down when the mouse event was fired.
        Parameters:
        ctrl - true if the control key was down when the mouse event was fired
      • isMetaKey

        public default boolean isMetaKey()
        Returns true if the meta key was down when the mouse event was fired.
        Returns:
        true if the meta key was down when the mouse event was fired
      • setMetaKey

        public default void setMetaKey​(boolean meta)
        Sets true if the meta key was down when the mouse event was fired.
        Parameters:
        meta - true if the meta key was down when the mouse event was fired
      • isShiftKey

        public default boolean isShiftKey()
        Returns true if the shift key was down when the mouse event was fired.
        Returns:
        true if the shift key was down when the mouse event was fired
      • setShiftKey

        public default void setShiftKey​(boolean shift)
        Sets true if the shift key was down when the mouse event was fired.
        Parameters:
        shift - true if the shift key was down when the mouse event was fired
      • getDetail

        public final int getDetail()
        When non-zero, provides the current (or next, depending on the event) click count.
        For click events, is the current click count.
        For mousedown or mouseup events, is 1 plus the current click count.
        For all other, is always zero.
        Returns:
        When non-zero, provides the current (or next, depending on the event) click count.
        For click events, is the current click count.
        For mousedown or mouseup events, is 1 plus the current click count.
        For all other, is always zero
      • setDetail

        public final void setDetail​(int detail)
        Sets non-zero, provides the current (or next, depending on the event) click count.
        For click events, is the current click count.
        For mousedown or mouseup events, is 1 plus the current click count.
        For all other, is always zero
        Parameters:
        detail - non-zero, provides the current (or next, depending on the event) click count.
        For click events, is the current click count.
        For mousedown or mouseup events, is 1 plus the current click count.
        For all other, is always zero