pub struct Touch {
pub x: i32,
pub y: i32,
pub identifier: i32,
pub pressure: i32,
pub touch_major: i32,
pub touch_minor: i32,
pub expiration: i32,
pub orientation: i32,
}Expand description
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.
Fields§
§x: i32The horizontal coordinate. This is the physical location on the screen For example 0 indicates the leftmost coordinate.
y: i32The vertical coordinate. This is the physical location on the screen For example 0 indicates the top left coordinate.
identifier: i32The identifier is an arbitrary non-negative integer that is used to identify and track each tool independently when multiple tools are active. For example, when multiple fingers are touching the device, each finger should be assigned a distinct tracking id that is used as long as the finger remains in contact. Tracking ids may be reused when their associated tools move out of range.
The emulator currently supports up to 10 concurrent touch events. The identifier can be any uninque value and will be mapped to the next available internal identifier.
pressure: i32Reports the physical pressure applied to the tip of the tool or the signal strength of the touch contact.
The values reported must be non-zero when the tool is touching the device and zero otherwise to indicate that the touch event is completed.
Make sure to deliver a pressure of 0 for the given identifier when the touch event is completed, otherwise the touch identifier will not be unregistered!
touch_major: i32Optionally reports the cross-sectional area of the touch contact, or the length of the longer dimension of the touch contact.
touch_minor: i32Optionally reports the length of the shorter dimension of the touch contact. This axis will be ignored if touch_major is reporting an area measurement greater than 0.
expiration: i32§orientation: i32The orientation of the contact, if any.
Implementations§
Source§impl Touch
impl Touch
Sourcepub fn expiration(&self) -> EventExpiration
pub fn expiration(&self) -> EventExpiration
Returns the enum value of expiration, or the default if the field is set to an invalid enum value.
Sourcepub fn set_expiration(&mut self, value: EventExpiration)
pub fn set_expiration(&mut self, value: EventExpiration)
Sets expiration to the provided enum value.
Trait Implementations§
Source§impl Message for Touch
impl Message for Touch
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.impl Copy for Touch
impl Eq for Touch
impl StructuralPartialEq for Touch
Auto Trait Implementations§
impl Freeze for Touch
impl RefUnwindSafe for Touch
impl Send for Touch
impl Sync for Touch
impl Unpin for Touch
impl UnwindSafe for Touch
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request