Struct input::event::tablet_tool::TabletToolProximityEvent
source · pub struct TabletToolProximityEvent { /* private fields */ }
Expand description
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.
Implementations
sourceimpl TabletToolProximityEvent
impl TabletToolProximityEvent
sourcepub fn proximity_state(&self) -> ProximityState
pub fn proximity_state(&self) -> ProximityState
Returns the new proximity state of a tool from a proximity event.
Used to check whether or not a tool came in or out of proximity during an
TabletToolProximityEvent
.
See Handling of proximity events for recommendations on proximity handling.
Trait Implementations
sourceimpl AsRaw<libinput_event_tablet_tool> for TabletToolProximityEvent
impl AsRaw<libinput_event_tablet_tool> for TabletToolProximityEvent
sourcefn as_raw(&self) -> *const libinput_event_tablet_tool
fn as_raw(&self) -> *const libinput_event_tablet_tool
sourceimpl Context for TabletToolProximityEvent
impl Context for TabletToolProximityEvent
sourceimpl Debug for TabletToolProximityEvent
impl Debug for TabletToolProximityEvent
sourceimpl Drop for TabletToolProximityEvent
impl Drop for TabletToolProximityEvent
sourceimpl EventTrait for TabletToolProximityEvent
impl EventTrait for TabletToolProximityEvent
sourceimpl Hash for TabletToolProximityEvent
impl Hash for TabletToolProximityEvent
sourceimpl PartialEq<TabletToolProximityEvent> for TabletToolProximityEvent
impl PartialEq<TabletToolProximityEvent> for TabletToolProximityEvent
impl Eq for TabletToolProximityEvent
impl StructuralEq for TabletToolProximityEvent
Auto Trait Implementations
impl !RefUnwindSafe for TabletToolProximityEvent
impl !Send for TabletToolProximityEvent
impl !Sync for TabletToolProximityEvent
impl Unpin for TabletToolProximityEvent
impl !UnwindSafe for TabletToolProximityEvent
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<T> TabletToolEventTrait for Twhere
T: AsRaw<libinput_event_tablet_tool> + Context,
impl<T> TabletToolEventTrait for Twhere
T: AsRaw<libinput_event_tablet_tool> + Context,
sourcefn distance_has_changed(&self) -> bool
fn distance_has_changed(&self) -> bool
sourcefn distance(&self) -> f64
fn distance(&self) -> f64
sourcefn pressure_has_changed(&self) -> bool
fn pressure_has_changed(&self) -> bool
TabletToolButtonEvent
s this function always returns false
.sourcefn pressure(&self) -> f64
fn pressure(&self) -> f64
sourcefn rotation_has_changed(&self) -> bool
fn rotation_has_changed(&self) -> bool
sourcefn rotation(&self) -> f64
fn rotation(&self) -> f64
sourcefn slider_has_changed(&self) -> bool
fn slider_has_changed(&self) -> bool
sourcefn slider_position(&self) -> f64
fn slider_position(&self) -> f64
sourcefn tilt_x_has_changed(&self) -> bool
fn tilt_x_has_changed(&self) -> bool
sourcefn tilt_y_has_changed(&self) -> bool
fn tilt_y_has_changed(&self) -> bool
sourcefn tilt_x(&self) -> f64
fn tilt_x(&self) -> f64
sourcefn tilt_y(&self) -> f64
fn tilt_y(&self) -> f64
sourcefn wheel_has_changed(&self) -> bool
fn wheel_has_changed(&self) -> bool
sourcefn wheel_delta(&self) -> f64
fn wheel_delta(&self) -> f64
sourcefn wheel_delta_discrete(&self) -> f64
fn wheel_delta_discrete(&self) -> f64
sourcefn x_has_changed(&self) -> bool
fn x_has_changed(&self) -> bool
sourcefn y_has_changed(&self) -> bool
fn y_has_changed(&self) -> bool
sourcefn x(&self) -> f64
fn x(&self) -> f64
sourcefn y(&self) -> f64
fn y(&self) -> f64
sourcefn x_transformed(&self, width: u32) -> f64
fn x_transformed(&self, width: u32) -> f64
sourcefn y_transformed(&self, height: u32) -> f64
fn y_transformed(&self, height: u32) -> f64
sourcefn tool(&self) -> TabletTool
fn tool(&self) -> TabletTool
sourcefn into_tablet_tool_event(self) -> TabletToolEventwhere
Self: Sized,
fn into_tablet_tool_event(self) -> TabletToolEventwhere
Self: Sized,
TabletToolEvent
again