pub trait TouchEventPosition: AsRaw<libinput_event_touch> {
// Provided methods
fn x(&self) -> f64 { ... }
fn y(&self) -> f64 { ... }
fn x_transformed(&self, width: u32) -> f64 { ... }
fn y_transformed(&self, height: u32) -> f64 { ... }
}
Expand description
Position related functions all TouchEvents implement, that have a screen position assigned to them.
Provided Methods§
Sourcefn x(&self) -> f64
fn x(&self) -> f64
Return the current absolute x coordinate of the touch event, in mm from the top left corner of the device.
To get the corresponding output screen coordinate, use x_transformed
.
Sourcefn y(&self) -> f64
fn y(&self) -> f64
Return the current absolute y coordinate of the touch event, in mm from the top left corner of the device.
To get the corresponding output screen coordinate, use y_transformed
.
Sourcefn x_transformed(&self, width: u32) -> f64
fn x_transformed(&self, width: u32) -> f64
Return the current absolute x coordinate of the touch event, transformed to screen coordinates.
§Arguments
- width - The current output screen width
Sourcefn y_transformed(&self, height: u32) -> f64
fn y_transformed(&self, height: u32) -> f64
Return the current absolute y coordinate of the touch event, transformed to screen coordinates.
§Arguments
- height - The current output screen height