Class KeyboardEventInit
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.dom.events.EventInit
-
- org.pepstock.charba.client.dom.events.KeyboardEventInit
-
public final class KeyboardEventInit extends EventInit
Initialization object for aNativeKeyboardEvent.- Author:
- Andrea "Stock" Stocchero
-
-
Constructor Summary
Constructors Constructor Description KeyboardEventInit()Creates an empty objectKeyboardEventInit(String key)Creates an initialization object, setting the keyboard key value.KeyboardEventInit(NativeKeyboardEvent source)Creates an initialization object, cloning all source event data
-
Method Summary
All Methods Instance Methods Concrete Methods Default Methods Modifier and Type Method Description StringgetCode()Returns a string, defaulting to "", that sets the value ofNativeKeyboardEventcode, represents a physical key on the keyboard (as opposed to the character generated by pressing the key).intgetDetail()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.StringgetKey()Returns a string, defaulting to "", that sets the value ofNativeKeyboardEventkey, the value of the key pressed by the user.KeyboardLocationgetLocation()Returns the location of the key on the keyboard or other input device.org.pepstock.charba.client.dom.events.ModifiersHandlergetModifiersHandler()default booleanisAltKey()Returns true if the alt key was down when the mouse event was fired.default booleanisCtrlKey()Returns true if the control key was down when the mouse event was fired.default booleanisMetaKey()Returns true if the meta key was down when the mouse event was fired.booleanisRepeat()Returns a boolean value that is true if the given key is being held down such that it is automatically repeating.default booleanisShiftKey()Returns true if the shift key was down when the mouse event was fired.default voidsetAltKey(boolean alt)Sets true if the alt key was down when the mouse event was fired.voidsetCode(String code)Sets a string that sets the value ofNativeKeyboardEventcode, represents a physical key on the keyboard (as opposed to the character generated by pressing the key).default voidsetCtrlKey(boolean ctrl)Sets true if the control key was down when the mouse event was fired.voidsetDetail(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 zerovoidsetKey(String key)Sets a string that sets the value ofNativeKeyboardEventkey, the value of the key pressed by the uservoidsetLocation(KeyboardLocation location)Sets the location of the key on the keyboard or other input device.default voidsetMetaKey(boolean meta)Sets true if the meta key was down when the mouse event was fired.voidsetRepeat(boolean repeat)Sets a boolean value that is true if the given key is being held down such that it is automatically repeating.default voidsetShiftKey(boolean shift)Sets true if the shift key was down when the mouse event was fired.-
Methods inherited from class org.pepstock.charba.client.dom.events.EventInit
isBubbles, isCancelable, setBubbles, setCancelable
-
Methods inherited from class org.pepstock.charba.client.commons.NativeObjectContainer
checkAndGetColor, checkDefaultValuesArgument, empty, getArrayValue, getElement, getIncrementalId, getNativeChart, getNativeEvent, getNativeObject, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, has, has, isType, keys, loadNativeObject, remove, remove, setArrayValue, setArrayValue, setArrayValue, setElement, setEmptyValue, setNewIncrementalId, setNewIncrementalId, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
-
-
-
-
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 ofNativeKeyboardEventkey, the value of the key pressed by the user.- Returns:
- a string, defaulting to "", that sets the value of
NativeKeyboardEventkey, the value of the key pressed by the user
-
setKey
public void setKey(String key)
Sets a string that sets the value ofNativeKeyboardEventkey, the value of the key pressed by the user- Parameters:
key- a string that sets the value ofNativeKeyboardEventkey, the value of the key pressed by the user
-
getCode
public String getCode()
Returns a string, defaulting to "", that sets the value ofNativeKeyboardEventcode, 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
NativeKeyboardEventcode, 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 ofNativeKeyboardEventcode, 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 ofNativeKeyboardEventcode, 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
-
-