Class NativeTouchEvent
- java.lang.Object
-
- org.pepstock.charba.client.dom.events.NativeBaseEvent
-
- org.pepstock.charba.client.dom.events.NativeUIEvent
-
- org.pepstock.charba.client.dom.events.NativeTouchEvent
-
- All Implemented Interfaces:
IsJSType
,IsCastable
@JsType(isNative=true, name="TouchEvent", namespace="<global>") public final class NativeTouchEvent extends NativeUIEvent
Represents anNativeUIEvent
which is sent when the state of contacts with a touch-sensitive surface changes.
This surface can be a touch screen or trackpad, for example.
The event can describe one or more points of contact with the screen and includes support for detecting movement, addition and removal of contact points, and so forth.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NativeTouchEvent
createTouchEvent(String type)
Creates a new event object for a specific event type.static NativeTouchEvent
createTouchEvent(String type, TouchEventInit init)
Creates a new event object for a specific event type with initial configuration.static NativeTouchEvent
createTouchEvent(IsEvent type)
Creates a new event object for a specific event type.static NativeTouchEvent
createTouchEvent(IsEvent type, TouchEventInit init)
Creates a new event object for a specific event type with initial configuration.TouchList
getChangedTouches()
Returns a list of all the touch objects representing individual points of contact whose states changed between the previous touch event and this one.TouchList
getTargetTouches()
Returns a list of all the touch objects that are both currently in contact with the touch surface and were also started on the same element that is the target of the event.TouchList
getTouches()
Returns a list of all the touch objects representing all current points of contact with the surface, regardless of target or changed status.boolean
isAltKey()
Returns true if the alt key was down when the touch event was fired.boolean
isCtrlKey()
Returns true if the control key was down when the touch event was fired.boolean
isMetaKey()
Returns true if the meta key was down when the touch event was fired.boolean
isShiftKey()
Returns true if the shift key was down when the touch event was fired.-
Methods inherited from class org.pepstock.charba.client.dom.events.NativeUIEvent
getDetail, getModifierState
-
Methods inherited from class org.pepstock.charba.client.dom.events.NativeBaseEvent
createEvent, createEvent, createEvent, createEvent, getCurrentTarget, getEventPhase, getTarget, getType, isBubbles, isCancelable, isDefaultPrevented, preventDefault, stopImmediatePropagation, stopPropagation
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.pepstock.charba.client.dom.IsCastable
as
-
-
-
-
Method Detail
-
isAltKey
@JsProperty public boolean isAltKey()
Returns true if the alt key was down when the touch event was fired.- Returns:
- true if the alt key was down when the touch event was fired
-
isCtrlKey
@JsProperty public boolean isCtrlKey()
Returns true if the control key was down when the touch event was fired.- Returns:
- true if the control key was down when the touch event was fired
-
isMetaKey
@JsProperty public boolean isMetaKey()
Returns true if the meta key was down when the touch event was fired.- Returns:
- true if the meta key was down when the touch event was fired
-
isShiftKey
@JsProperty public boolean isShiftKey()
Returns true if the shift key was down when the touch event was fired.- Returns:
- true if the shift key was down when the touch event was fired
-
getChangedTouches
@JsProperty public TouchList getChangedTouches()
Returns a list of all the touch objects representing individual points of contact whose states changed between the previous touch event and this one.- Returns:
- a list of all the touch objects representing individual points of contact whose states changed between the previous touch event and this one
-
getTargetTouches
@JsProperty public TouchList getTargetTouches()
Returns a list of all the touch objects that are both currently in contact with the touch surface and were also started on the same element that is the target of the event.- Returns:
- a list of all the touch objects that are both currently in contact with the touch surface and were also started on the same element that is the target of the event
-
getTouches
@JsProperty public TouchList getTouches()
Returns a list of all the touch objects representing all current points of contact with the surface, regardless of target or changed status.- Returns:
- a list of all the touch objects representing all current points of contact with the surface, regardless of target or changed status
-
createTouchEvent
@JsOverlay public static NativeTouchEvent createTouchEvent(String type)
Creates a new event object for a specific event type.- Parameters:
type
- type of event- Returns:
- a new event object for a specific event type
-
createTouchEvent
@JsOverlay public static NativeTouchEvent createTouchEvent(IsEvent type)
Creates a new event object for a specific event type.- Parameters:
type
- type of event- Returns:
- a new event object for a specific event type
-
createTouchEvent
@JsOverlay public static NativeTouchEvent createTouchEvent(IsEvent type, TouchEventInit init)
Creates a new event object for a specific event type with initial configuration.- Parameters:
type
- type of eventinit
- initial configuration of the event- Returns:
- a new event object for a specific event type
-
createTouchEvent
@JsOverlay public static NativeTouchEvent createTouchEvent(String type, TouchEventInit init)
Creates a new event object for a specific event type with initial configuration.- Parameters:
type
- type of eventinit
- initial configuration of the event- Returns:
- a new event object for a specific event type
-
-