Enum zng_view_api::touch::TouchForce
source · pub enum TouchForce {
Calibrated {
force: f64,
max_possible_force: f64,
altitude_angle: Option<f64>,
},
Normalized(f64),
}Expand description
Describes the force of a touch event.
Variants§
Calibrated
On iOS, the force is calibrated so that the same number corresponds to roughly the same amount of pressure on the screen regardless of the device.
Fields
force: f64The force of the touch, where a value of 1.0 represents the force of an average touch (predetermined by the system, not user-specific).
The force reported by Apple Pencil is measured along the axis of the
pencil. If you want a force perpendicular to the device, you need to
calculate this value using the altitude_angle value.
Normalized(f64)
If the platform reports the force as normalized, we have no way of knowing how much pressure 1.0 corresponds to – we know it’s the maximum amount of force, but as to how much force, you might either have to press really hard, or not hard at all, depending on the device.
Trait Implementations§
source§impl Clone for TouchForce
impl Clone for TouchForce
source§fn clone(&self) -> TouchForce
fn clone(&self) -> TouchForce
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for TouchForce
impl Debug for TouchForce
source§impl<'de> Deserialize<'de> for TouchForce
impl<'de> Deserialize<'de> for TouchForce
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for TouchForce
impl PartialEq for TouchForce
source§fn eq(&self, other: &TouchForce) -> bool
fn eq(&self, other: &TouchForce) -> bool
self and other values to be equal, and is used
by ==.