Trait input::event::tablet_tool::TabletToolEventTrait
[−]
[src]
pub trait TabletToolEventTrait: AsRaw<libinput_event_tablet_tool> {
fn time(&self) -> u32 { ... }
fn time_usec(&self) -> u64 { ... }
fn distance_has_changed(&self) -> bool { ... }
fn distance(&self) -> f64 { ... }
fn dx(&self) -> f64 { ... }
fn dy(&self) -> f64 { ... }
fn pressure_has_changed(&self) -> bool { ... }
fn pressure(&self) -> f64 { ... }
fn rotation_has_changed(&self) -> bool { ... }
fn rotation(&self) -> f64 { ... }
fn slider_has_changed(&self) -> bool { ... }
fn slider_position(&self) -> f64 { ... }
fn tilt_x_has_changed(&self) -> bool { ... }
fn tilt_y_has_changed(&self) -> bool { ... }
fn tilt_x(&self) -> f64 { ... }
fn tilt_y(&self) -> f64 { ... }
fn wheel_has_changed(&self) -> bool { ... }
fn wheel_delta(&self) -> f64 { ... }
fn wheel_delta_discrete(&self) -> f64 { ... }
fn x_has_changed(&self) -> bool { ... }
fn y_has_changed(&self) -> bool { ... }
fn x(&self) -> f64 { ... }
fn y(&self) -> f64 { ... }
fn x_transformed(&self, width: u32) -> f64 { ... }
fn y_transformed(&self, height: u32) -> f64 { ... }
fn tool(&self) -> TabletTool { ... }
fn into_tablet_tool_event(self) -> TabletToolEvent where Self: Sized { ... }
}Common functions all TabletTool-Events implement.
Provided Methods
fn time(&self) -> u32
The event time for this event
fn time_usec(&self) -> u64
The event time for this event in microseconds
fn distance_has_changed(&self) -> bool
Check if the distance axis was updated in this event.
For TabletToolProximityEvents this function always returns true. For
TabletToolButtonEvents this function always returns false.
fn distance(&self) -> f64
Returns the current distance from the tablet's sensor, normalized to the range [0, 1].
If this axis does not exist on the current tool, this function returns 0.
fn dx(&self) -> f64
Return the delta between the last event and the current event.
If the tool employs pointer acceleration, the delta returned by this function is the accelerated delta.
This value is in screen coordinate space, the delta is to be interpreted like
the return value of PointerMotionEvent::dx. See
Relative motion for tablet tools
for more details.
fn dy(&self) -> f64
Return the delta between the last event and the current event.
If the tool employs pointer acceleration, the delta returned by this function is the accelerated delta.
This value is in screen coordinate space, the delta is to be interpreted like
the return value of PointerMotionEvent::dy. See
Relative motion for tablet tools
for more details.
fn pressure_has_changed(&self) -> bool
Check if the pressure axis was updated in this event. For TabletToolButtonEvents this function always returns false.
fn pressure(&self) -> f64
Returns the current pressure being applied on the tool in use, normalized to the range [0, 1].
If this axis does not exist on the current tool, this function returns 0.
fn rotation_has_changed(&self) -> bool
Check if the z-rotation axis was updated in this event.
For TabletToolButtonEvents this function always returns false.
fn rotation(&self) -> f64
Returns the current z rotation of the tool in degrees, clockwise from the tool's logical neutral position.
For tools of type TabletToolType::Mouse and TabletToolType::Lens the logical
neutral position is pointing to the current logical north of the tablet. For
tools of type TabletToolType::Brush, the logical neutral position is with the
buttons pointing up.
If this axis does not exist on the current tool, this function returns 0.
fn slider_has_changed(&self) -> bool
Check if the slider axis was updated in this event.
For TabletToolButtonEvents this function always returns false.
fn slider_position(&self) -> f64
Returns the current position of the slider on the tool, normalized to the range [-1, 1].
The logical zero is the neutral position of the slider, or the logical center of the axis. This axis is available on e.g. the Wacom Airbrush.
If this axis does not exist on the current tool, this function returns 0.
fn tilt_x_has_changed(&self) -> bool
Check if the tilt x axis was updated in this event.
For TabletToolButtonEvents this function always returns false.
fn tilt_y_has_changed(&self) -> bool
Check if the tilt y axis was updated in this event.
For TabletToolButtonEvents this function always returns false.
fn tilt_x(&self) -> f64
Returns the current tilt along the X axis of the tablet's current logical orientation, in degrees off the tablet's z axis.
That is, if the tool is perfectly orthogonal to the tablet, the tilt angle is 0. When the top tilts towards the logical top/left of the tablet, the x/y tilt angles are negative, if the top tilts towards the logical bottom/right of the tablet, the x/y tilt angles are positive.
If this axis does not exist on the current tool, this function returns 0.
fn tilt_y(&self) -> f64
Returns the current tilt along the Y axis of the tablet's current logical orientation, in degrees off the tablet's z axis.
That is, if the tool is perfectly orthogonal to the tablet, the tilt angle is 0. When the top tilts towards the logical top/left of the tablet, the x/y tilt angles are negative, if the top tilts towards the logical bottom/right of the tablet, the x/y tilt angles are positive.
If this axis does not exist on the current tool, this function returns 0.
fn wheel_has_changed(&self) -> bool
Check if the wheel axis was updated in this event.
For TabletToolButtonEvents this function always returns false.
fn wheel_delta(&self) -> f64
Return the delta for the wheel in degrees.
fn wheel_delta_discrete(&self) -> f64
Return the delta for the wheel in discrete steps (e.g. wheel clicks).
fn x_has_changed(&self) -> bool
Check if the x axis was updated in this event.
For TabletToolButtonEvents this function always returns false.
fn y_has_changed(&self) -> bool
Check if the y axis was updated in this event.
For TabletToolButtonEvents this function always returns false.
fn x(&self) -> f64
Returns the X coordinate of the tablet tool, in mm from the top left corner of the tablet in its current logical orientation.
Use x_transformed for transforming the axis value into a different coordinate
space.
Note
On some devices, returned value may be negative or larger than the width of the device. See Out-of-bounds motion events for more details.
fn y(&self) -> f64
Returns the Y coordinate of the tablet tool, in mm from the top left corner of the tablet in its current logical orientation.
Use y_transformed for transforming the axis value into a different coordinate
space.
Note
On some devices, returned value may be negative or larger than the width of the device. See Out-of-bounds motion events for more details.
fn x_transformed(&self, width: u32) -> f64
Return the current absolute x coordinate of the tablet tool event, transformed to screen coordinates.
Note
This function may be called for a specific axis even if x_has_changed returns
false for that axis. libinput always includes all device axes in the event.
On some devices, returned value may be negative or larger than the width of the device. See Out-of-bounds motion events for more details.
fn y_transformed(&self, height: u32) -> f64
Return the current absolute y coordinate of the tablet tool event, transformed to screen coordinates.
Note
This function may be called for a specific axis even if y_has_changed returns
false for that axis. libinput always includes all device axes in the event.
On some devices, returned value may be negative or larger than the width of the device. See Out-of-bounds motion events for more details.
fn tool(&self) -> TabletTool
Returns the tool that was in use during this event.
Note
Physical tool tracking requires hardware support. If unavailable, libinput creates one tool per type per tablet. See Tracking unique tools for more details.
fn into_tablet_tool_event(self) -> TabletToolEvent where Self: Sized
Convert into a general TabletToolEvent again
Implementors
impl<T: AsRaw<libinput_event_tablet_tool>> TabletToolEventTrait for T