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.
Provided Methods§
Sourcefn pointer_id(&self) -> i32
fn pointer_id(&self) -> i32
Returns a unique identifier for the pointer causing the event.
Sourcefn width(&self) -> f64
fn width(&self) -> f64
Returns the width, in CSS pixels, of the contact geometry of the pointer.
Sourcefn height(&self) -> f64
fn height(&self) -> f64
Returns the height, in CSS pixels, of the contact geometry of the pointer.
Sourcefn tangential_pressure(&self) -> f64
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
Sourcefn tilt_x(&self) -> i32
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.
Sourcefn tilt_y(&self) -> i32
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.
Sourcefn twist(&self) -> i32
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
Sourcefn pointer_type(&self) -> String
fn pointer_type(&self) -> String
Indicates the device type that caused the event.
Sourcefn is_primary(&self) -> bool
fn is_primary(&self) -> bool
Indicates if the pointer represents the primary pointer of this pointer type
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.