#[non_exhaustive]pub enum TabletToolEvent {
Axis(TabletToolAxisEvent),
Proximity(TabletToolProximityEvent),
Tip(TabletToolTipEvent),
Button(TabletToolButtonEvent),
}
Expand description
An event related to a tablet tool
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Axis(TabletToolAxisEvent)
One or more axes have changed state on a device with the
DeviceCapability::TabletTool
capability.
This event is only sent when the tool is in proximity, see
TabletToolProximityEvent
for details.
The proximity event contains the initial state of the axis as the tool comes into
proximity. An event of type TabletToolAxisEvent
is only sent when an axis value
changes from this initial state. It is possible for a tool to enter and leave
proximity without sending an event of type TabletToolAxisEvent
.
An event of type TabletToolAxisEvent
is sent when the tip state does not
change. See the documentation for TabletToolTipEvent
for more details.
Proximity(TabletToolProximityEvent)
Signals that a tool has come in or out of proximity of a device with the
DeviceCapability::TabletTool
capability.
Proximity events contain each of the current values for each axis, and these
values may be extracted from them in the same way they are with
TabletToolAxisEvent
events.
Some tools may always be in proximity. For these tools, proximity events with
ProximityState::In
are sent only once after DeviceAddedEvent
, and proximity
events with ProximityState::Out
are sent only once before DeviceRemovedEvent
.
If the tool that comes into proximity supports x/y coordinates, libinput guarantees that both x and y are set in the proximity event.
When a tool goes out of proximity, the value of every axis should be assumed to have an undefined state and any buttons that are currently held down on the stylus are marked as released. Button release events for each button that was held down on the stylus are sent before the proximity out event.
Tip(TabletToolTipEvent)
Signals that a tool has come in contact with the surface of a device with the
DeviceCapability::TabletTool
capability.
On devices without distance proximity detection, the TabletToolTipEvent
is sent
immediately after TabletToolProximityEvent
for the tip down event, and
immediately before for the tip up event.
The decision when a tip touches the surface is device-dependent and may be
derived from pressure data or other means. If the tip state is changed by axes
changing state, the TabletToolTipEvent
includes the changed axes and no
additional axis event is sent for this state change. In other words, a caller
must look at both TabletToolAxisEvent
and TabletToolTipEvent
events to know
the current state of the axes.
If a button state change occurs at the same time as a tip state change, the order of events is device-dependent.
Button(TabletToolButtonEvent)
Signals that a tool has changed a logical button state on a device with the
DeviceCapability::TabletTool
capability.
Button state changes occur on their own and do not include axis state changes. If
button and axis state changes occur within the same logical hardware event, the
order of the TabletToolButtonEvent
and TabletToolAxisEvent
is device-specific.
This event is not to be confused with the button events emitted by the tablet
pad. See TabletPadButtonEvent
.
Trait Implementations§
Source§impl AsRaw<libinput_event_tablet_tool> for TabletToolEvent
impl AsRaw<libinput_event_tablet_tool> for TabletToolEvent
Source§fn as_raw(&self) -> *const libinput_event_tablet_tool
fn as_raw(&self) -> *const libinput_event_tablet_tool
Source§impl Context for TabletToolEvent
impl Context for TabletToolEvent
Source§impl Debug for TabletToolEvent
impl Debug for TabletToolEvent
Source§impl EventTrait for TabletToolEvent
impl EventTrait for TabletToolEvent
Source§impl Hash for TabletToolEvent
impl Hash for TabletToolEvent
Source§impl PartialEq for TabletToolEvent
impl PartialEq for TabletToolEvent
impl Eq for TabletToolEvent
impl StructuralPartialEq for TabletToolEvent
Auto Trait Implementations§
impl Freeze for TabletToolEvent
impl !RefUnwindSafe for TabletToolEvent
impl !Send for TabletToolEvent
impl !Sync for TabletToolEvent
impl Unpin for TabletToolEvent
impl !UnwindSafe for TabletToolEvent
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> TabletToolEventTrait for T
impl<T> TabletToolEventTrait for T
Source§fn distance_has_changed(&self) -> bool
fn distance_has_changed(&self) -> bool
Source§fn distance(&self) -> f64
fn distance(&self) -> f64
Source§fn pressure_has_changed(&self) -> bool
fn pressure_has_changed(&self) -> bool
TabletToolButtonEvent
s this function always returns false
.Source§fn pressure(&self) -> f64
fn pressure(&self) -> f64
Source§fn rotation_has_changed(&self) -> bool
fn rotation_has_changed(&self) -> bool
Source§fn rotation(&self) -> f64
fn rotation(&self) -> f64
Source§fn slider_has_changed(&self) -> bool
fn slider_has_changed(&self) -> bool
Source§fn slider_position(&self) -> f64
fn slider_position(&self) -> f64
Source§fn tilt_x_has_changed(&self) -> bool
fn tilt_x_has_changed(&self) -> bool
Source§fn tilt_y_has_changed(&self) -> bool
fn tilt_y_has_changed(&self) -> bool
Source§fn tilt_x(&self) -> f64
fn tilt_x(&self) -> f64
Source§fn tilt_y(&self) -> f64
fn tilt_y(&self) -> f64
Source§fn size_major_has_changed(&self) -> bool
fn size_major_has_changed(&self) -> bool
Source§fn size_minor_has_changed(&self) -> bool
fn size_minor_has_changed(&self) -> bool
Source§fn size_major(&self) -> f64
fn size_major(&self) -> f64
Source§fn size_minor(&self) -> f64
fn size_minor(&self) -> f64
Source§fn wheel_has_changed(&self) -> bool
fn wheel_has_changed(&self) -> bool
Source§fn wheel_delta(&self) -> f64
fn wheel_delta(&self) -> f64
Source§fn wheel_delta_discrete(&self) -> f64
fn wheel_delta_discrete(&self) -> f64
Source§fn x_has_changed(&self) -> bool
fn x_has_changed(&self) -> bool
Source§fn y_has_changed(&self) -> bool
fn y_has_changed(&self) -> bool
Source§fn x(&self) -> f64
fn x(&self) -> f64
Source§fn y(&self) -> f64
fn y(&self) -> f64
Source§fn x_transformed(&self, width: u32) -> f64
fn x_transformed(&self, width: u32) -> f64
Source§fn y_transformed(&self, height: u32) -> f64
fn y_transformed(&self, height: u32) -> f64
Source§fn tool(&self) -> TabletTool
fn tool(&self) -> TabletTool
Source§fn into_tablet_tool_event(self) -> TabletToolEventwhere
Self: Sized,
fn into_tablet_tool_event(self) -> TabletToolEventwhere
Self: Sized,
TabletToolEvent
again