stdweb::web::event

Trait IPointerEvent

Source
pub trait IPointerEvent: IMouseEvent {
    // Provided methods
    fn pointer_id(&self) -> i32 { ... }
    fn width(&self) -> f64 { ... }
    fn height(&self) -> f64 { ... }
    fn pressure(&self) -> f64 { ... }
    fn tangential_pressure(&self) -> f64 { ... }
    fn tilt_x(&self) -> i32 { ... }
    fn tilt_y(&self) -> i32 { ... }
    fn twist(&self) -> i32 { ... }
    fn pointer_type(&self) -> String { ... }
    fn is_primary(&self) -> bool { ... }
}
Expand description

The IPointerEvent interface represents the state of a DOM event produced by a pointer such as the geometry of the contact point, the device type that generated the event, the amount of pressure that was applied on the contact surface, etc.

(JavaScript docs)

Provided Methods§

Source

fn pointer_id(&self) -> i32

Returns a unique identifier for the pointer causing the event.

(JavaScript docs)

Source

fn width(&self) -> f64

Returns the width, in CSS pixels, of the contact geometry of the pointer.

(JavaScript docs)

Source

fn height(&self) -> f64

Returns the height, in CSS pixels, of the contact geometry of the pointer.

(JavaScript docs)

Source

fn pressure(&self) -> f64

Returns the normalized pressure of the pointer in the range [0, 1]

(JavaScript docs)

Source

fn tangential_pressure(&self) -> f64

Returns the normalized tangential pressure of the pointer in the range [-1, 1], where 0 is the hardware’s neutral position

(JavaScript docs)

Source

fn tilt_x(&self) -> i32

Returns the angle, in the range of [-90, 90] degrees, between the Y-Z plane and the plane containing the transducer (e.g. pen stylus) and the Y axis.

(JavaScript docs)

Source

fn tilt_y(&self) -> i32

Returns the angle, in the range of [-90, 90] degrees, between the X-Z plane and the plane containing the transducer (e.g. pen stylus) and the X axis.

(JavaScript docs)

Source

fn twist(&self) -> i32

Returns the clockwise rotation, in the range of [0, 359] degrees, of the transducer (e.g. pen stylus) around it’s own major axis

(JavaScript docs)

Source

fn pointer_type(&self) -> String

Indicates the device type that caused the event.

(JavaScript docs)

Source

fn is_primary(&self) -> bool

Indicates if the pointer represents the primary pointer of this pointer type

(JavaScript docs)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§