[][src]Struct stdweb::web::Touch

pub struct Touch(_);

The Touch interface represents a single contact point on a touch-sensitive device. The contact point is commonly a finger or stylus and the device may be a touchscreen or trackpad.

(JavaScript docs)

Methods

impl Touch[src]

pub fn identifier(&self) -> i32[src]

Returns a unique identifier for this Touch object. A given touch point (say, by a finger) will have the same identifier for the duration of its movement around the surface. This lets you ensure that you're tracking the same touch all the time.

(JavaScript docs)

pub fn screen_x(&self) -> f64[src]

Returns the X coordinate of the touch point relative to the left edge of the screen.

(JavaScript docs)

pub fn screen_y(&self) -> f64[src]

Returns the Y coordinate of the touch point relative to the left edge of the screen.

(JavaScript docs)

pub fn client_x(&self) -> f64[src]

Returns the X coordinate of the touch point relative to the left edge of the browser viewport, not including any scroll offset.

(JavaScript docs)

pub fn client_y(&self) -> f64[src]

Returns the Y coordinate of the touch point relative to the left edge of the browser viewport, not including any scroll offset.

(JavaScript docs)

pub fn page_x(&self) -> f64[src]

Returns the X coordinate of the touch point relative to the left edge of the document. Unlike clientX, this value includes the horizontal scroll offset, if any.

(JavaScript docs)

pub fn page_y(&self) -> f64[src]

Returns the Y coordinate of the touch point relative to the left edge of the document. Unlike clientX, this value includes the horizontal scroll offset, if any.

(JavaScript docs)

pub fn target(&self) -> EventTarget[src]

Returns the Element on which the touch point started when it was first placed on the surface, even if the touch point has since moved outside the interactive area of that element or even been removed from the document.

(JavaScript docs)

pub fn radius_x(&self) -> f64[src]

Returns the X radius of the ellipse that most closely circumscribes the area of contact with the screen. The value is in pixels of the same scale as screenX.

(JavaScript docs)

pub fn radius_y(&self) -> f64[src]

Returns the Y radius of the ellipse that most closely circumscribes the area of contact with the screen. The value is in pixels of the same scale as screenY.

(JavaScript docs)

pub fn rotation_angle(&self) -> f64[src]

Returns the angle (in degrees) that the ellipse described by radiusX and radiusY must be rotated, clockwise, to most accurately cover the area of contact between the user and the surface.

(JavaScript docs)

pub fn force(&self) -> f64[src]

Returns the amount of pressure being applied to the surface by the user, as a float between 0.0 (no pressure) and 1.0 (maximum pressure).

(JavaScript docs)

pub fn altitude_angle(&self) -> f64[src]

The altitude (in radians) of a stylus, in the range 0 (parallel to the surface) to π/2 (perpendicular to the surface). The value 0 should be used for devices which do not support this property.

(JavaScript docs)

pub fn azimuth_angle(&self) -> f64[src]

The azimuth angle (in radians) of a stylus, in the range 0 to 2π. 0 represents a stylus whose cap is pointing in the direction of increasing screenX values. π/2 represents a stylus whose cap is pointing in the direction of increasing screenY values. The value 0 should be used for devices which do not support this property.

(JavaScript docs)

pub fn touch_type(&self) -> TouchType[src]

The type of device used to trigger the touch.

Trait Implementations

impl JsSerialize for Touch[src]

impl TryFrom<Touch> for Reference[src]

type Error = Void

The type returned in the event of a conversion error.

impl TryFrom<Reference> for Touch[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl<'_r> TryFrom<&'_r Reference> for Touch[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl TryFrom<Value> for Touch[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl<'_r> TryFrom<&'_r Value> for Touch[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl InstanceOf for Touch[src]

impl ReferenceType for Touch[src]

impl AsRef<Reference> for Touch[src]

impl From<Touch> for Reference[src]

impl Clone for Touch[src]

impl Eq for Touch[src]

impl PartialEq<Touch> for Touch[src]

impl Debug for Touch[src]

Auto Trait Implementations

impl Send for Touch

impl Sync for Touch

impl Unpin for Touch

impl UnwindSafe for Touch

impl RefUnwindSafe for Touch

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]