pub struct LibinputInputBackend { /* private fields */ }Available on crate feature
backend_libinput only.Expand description
Libinput based InputBackend.
Tracks input of all devices given manually or via a udev seat to a provided libinput context.
Implementations§
Source§impl LibinputInputBackend
impl LibinputInputBackend
Sourcepub fn new(context: Libinput) -> Self
pub fn new(context: Libinput) -> Self
Initialize a new LibinputInputBackend from a given already initialized
libinput context.
Trait Implementations§
Source§impl<E> AbsolutePositionEvent<LibinputInputBackend> for Ewhere
E: IsTabletEvent + EventTrait,
impl<E> AbsolutePositionEvent<LibinputInputBackend> for Ewhere
E: IsTabletEvent + EventTrait,
Source§fn x_transformed(&self, width: i32) -> f64
fn x_transformed(&self, width: i32) -> f64
Device x position converted to the targets coordinate space’s width.
E.g. the focused output’s width.
Source§fn y_transformed(&self, height: i32) -> f64
fn y_transformed(&self, height: i32) -> f64
Device y position converted to the targets coordinate space’s height.
E.g. the focused output’s height.
Source§impl AbsolutePositionEvent<LibinputInputBackend> for PointerMotionAbsoluteEvent
impl AbsolutePositionEvent<LibinputInputBackend> for PointerMotionAbsoluteEvent
Source§fn x_transformed(&self, width: i32) -> f64
fn x_transformed(&self, width: i32) -> f64
Device x position converted to the targets coordinate space’s width.
E.g. the focused output’s width.
Source§fn y_transformed(&self, height: i32) -> f64
fn y_transformed(&self, height: i32) -> f64
Device y position converted to the targets coordinate space’s height.
E.g. the focused output’s height.
Source§impl AbsolutePositionEvent<LibinputInputBackend> for TouchDownEvent
impl AbsolutePositionEvent<LibinputInputBackend> for TouchDownEvent
Source§fn x_transformed(&self, width: i32) -> f64
fn x_transformed(&self, width: i32) -> f64
Device x position converted to the targets coordinate space’s width.
E.g. the focused output’s width.
Source§fn y_transformed(&self, height: i32) -> f64
fn y_transformed(&self, height: i32) -> f64
Device y position converted to the targets coordinate space’s height.
E.g. the focused output’s height.
Source§impl AbsolutePositionEvent<LibinputInputBackend> for TouchMotionEvent
impl AbsolutePositionEvent<LibinputInputBackend> for TouchMotionEvent
Source§fn x_transformed(&self, width: i32) -> f64
fn x_transformed(&self, width: i32) -> f64
Device x position converted to the targets coordinate space’s width.
E.g. the focused output’s width.
Source§fn y_transformed(&self, height: i32) -> f64
fn y_transformed(&self, height: i32) -> f64
Device y position converted to the targets coordinate space’s height.
E.g. the focused output’s height.
Source§impl AsFd for LibinputInputBackend
impl AsFd for LibinputInputBackend
Source§fn as_fd(&self) -> BorrowedFd<'_>
fn as_fd(&self) -> BorrowedFd<'_>
Borrows the file descriptor. Read more
Source§impl Debug for LibinputInputBackend
impl Debug for LibinputInputBackend
Source§impl<E> Event<LibinputInputBackend> for Ewhere
E: IsTabletEvent,
impl<E> Event<LibinputInputBackend> for Ewhere
E: IsTabletEvent,
Source§impl Event<LibinputInputBackend> for KeyboardKeyEvent
impl Event<LibinputInputBackend> for KeyboardKeyEvent
Source§impl Event<LibinputInputBackend> for TouchCancelEvent
impl Event<LibinputInputBackend> for TouchCancelEvent
Source§impl Event<LibinputInputBackend> for TouchDownEvent
impl Event<LibinputInputBackend> for TouchDownEvent
Source§impl Event<LibinputInputBackend> for TouchFrameEvent
impl Event<LibinputInputBackend> for TouchFrameEvent
Source§impl Event<LibinputInputBackend> for TouchMotionEvent
impl Event<LibinputInputBackend> for TouchMotionEvent
Source§impl Event<LibinputInputBackend> for TouchUpEvent
impl Event<LibinputInputBackend> for TouchUpEvent
Source§impl EventSource for LibinputInputBackend
impl EventSource for LibinputInputBackend
Source§type Event = InputEvent<LibinputInputBackend>
type Event = InputEvent<LibinputInputBackend>
The type of events generated by your source.
Source§type Error = Error
type Error = Error
The error type returned from
process_events() (not the user callback!).Source§fn process_events<F>(
&mut self,
_: Readiness,
token: Token,
callback: F,
) -> Result<PostAction>
fn process_events<F>( &mut self, _: Readiness, token: Token, callback: F, ) -> Result<PostAction>
Process any relevant events Read more
Source§fn register(
&mut self,
poll: &mut Poll,
factory: &mut TokenFactory,
) -> Result<()>
fn register( &mut self, poll: &mut Poll, factory: &mut TokenFactory, ) -> Result<()>
Register yourself to this poll instance Read more
Source§fn reregister(
&mut self,
poll: &mut Poll,
factory: &mut TokenFactory,
) -> Result<()>
fn reregister( &mut self, poll: &mut Poll, factory: &mut TokenFactory, ) -> Result<()>
Re-register your file descriptors Read more
Source§fn unregister(&mut self, poll: &mut Poll) -> Result<()>
fn unregister(&mut self, poll: &mut Poll) -> Result<()>
Unregister your file descriptors Read more
Source§const NEEDS_EXTRA_LIFECYCLE_EVENTS: bool = false
const NEEDS_EXTRA_LIFECYCLE_EVENTS: bool = false
Whether this source needs to be sent the
EventSource::before_sleep
and EventSource::before_handle_events notifications. These are opt-in because
they require more expensive checks, and almost all sources will not need these notificationsSource§fn before_sleep(&mut self) -> Result<Option<(Readiness, Token)>, Error>
fn before_sleep(&mut self) -> Result<Option<(Readiness, Token)>, Error>
Notification that a single
poll is about to begin Read moreSource§fn before_handle_events(&mut self, events: EventIterator<'_>)
fn before_handle_events(&mut self, events: EventIterator<'_>)
Notification that polling is complete, and
EventSource::process_events will
be called with the given events for this source. The iterator may be empty,
which indicates that no events were generated for this source Read moreSource§impl<T> GestureBeginEvent<LibinputInputBackend> for T
impl<T> GestureBeginEvent<LibinputInputBackend> for T
Source§impl<T> GestureEndEvent<LibinputInputBackend> for T
impl<T> GestureEndEvent<LibinputInputBackend> for T
Source§impl InputBackend for LibinputInputBackend
impl InputBackend for LibinputInputBackend
Source§type KeyboardKeyEvent = KeyboardKeyEvent
type KeyboardKeyEvent = KeyboardKeyEvent
Type representing keyboard events
Source§type PointerAxisEvent = PointerScrollAxis
type PointerAxisEvent = PointerScrollAxis
Type representing axis events on pointer devices
Source§type PointerButtonEvent = PointerButtonEvent
type PointerButtonEvent = PointerButtonEvent
Type representing button events on pointer devices
Source§type PointerMotionEvent = PointerMotionEvent
type PointerMotionEvent = PointerMotionEvent
Type representing motion events of pointer devices
Source§type PointerMotionAbsoluteEvent = PointerMotionAbsoluteEvent
type PointerMotionAbsoluteEvent = PointerMotionAbsoluteEvent
Type representing motion events of pointer devices
Source§type GestureSwipeBeginEvent = GestureSwipeBeginEvent
type GestureSwipeBeginEvent = GestureSwipeBeginEvent
Type representing swipe begin events of pointer devices
Source§type GestureSwipeUpdateEvent = GestureSwipeUpdateEvent
type GestureSwipeUpdateEvent = GestureSwipeUpdateEvent
Type representing swipe update events of pointer devices
Source§type GestureSwipeEndEvent = GestureSwipeEndEvent
type GestureSwipeEndEvent = GestureSwipeEndEvent
Type representing swipe end events of pointer devices
Source§type GesturePinchBeginEvent = GesturePinchBeginEvent
type GesturePinchBeginEvent = GesturePinchBeginEvent
Type representing pinch begin events of pointer devices
Source§type GesturePinchUpdateEvent = GesturePinchUpdateEvent
type GesturePinchUpdateEvent = GesturePinchUpdateEvent
Type representing pinch update events of pointer devices
Source§type GesturePinchEndEvent = GesturePinchEndEvent
type GesturePinchEndEvent = GesturePinchEndEvent
Type representing pinch end events of pointer devices
Source§type GestureHoldBeginEvent = GestureHoldBeginEvent
type GestureHoldBeginEvent = GestureHoldBeginEvent
Type representing hold begin events of pointer devices
Source§type GestureHoldEndEvent = GestureHoldEndEvent
type GestureHoldEndEvent = GestureHoldEndEvent
Type representing hold end events of pointer devices
Source§type TouchDownEvent = TouchDownEvent
type TouchDownEvent = TouchDownEvent
Type representing touch events starting
Source§type TouchUpEvent = TouchUpEvent
type TouchUpEvent = TouchUpEvent
Type representing touch events ending
Source§type TouchMotionEvent = TouchMotionEvent
type TouchMotionEvent = TouchMotionEvent
Type representing touch events from moving
Source§type TouchCancelEvent = TouchCancelEvent
type TouchCancelEvent = TouchCancelEvent
Type representing canceling of touch events
Source§type TouchFrameEvent = TouchFrameEvent
type TouchFrameEvent = TouchFrameEvent
Type representing touch frame events
Source§type TabletToolAxisEvent = TabletToolAxisEvent
type TabletToolAxisEvent = TabletToolAxisEvent
Type representing axis events on tablet devices
Source§type TabletToolProximityEvent = TabletToolProximityEvent
type TabletToolProximityEvent = TabletToolProximityEvent
Type representing proximity events on tablet devices
Source§type TabletToolTipEvent = TabletToolTipEvent
type TabletToolTipEvent = TabletToolTipEvent
Type representing tip events on tablet devices
Source§type TabletToolButtonEvent = TabletToolButtonEvent
type TabletToolButtonEvent = TabletToolButtonEvent
Type representing button events on tablet tool devices
Source§type SwitchToggleEvent = SwitchToggleEvent
type SwitchToggleEvent = SwitchToggleEvent
Type representing switch toggle events
Source§type SpecialEvent = UnusedEvent
type SpecialEvent = UnusedEvent
Special events that are custom to this backend
Source§impl PointerAxisEvent<LibinputInputBackend> for PointerScrollAxis
impl PointerAxisEvent<LibinputInputBackend> for PointerScrollAxis
Source§impl PointerMotionEvent<LibinputInputBackend> for PointerMotionEvent
impl PointerMotionEvent<LibinputInputBackend> for PointerMotionEvent
Source§fn delta_x(&self) -> f64
fn delta_x(&self) -> f64
Delta on the x axis between the last and new pointer device position interpreted as pixel movement
Source§fn delta_y(&self) -> f64
fn delta_y(&self) -> f64
Delta on the y axis between the last and new pointer device position interpreted as pixel movement
Source§fn delta_x_unaccel(&self) -> f64
fn delta_x_unaccel(&self) -> f64
Unaccelerated delta on the x axis between the last and new pointer device position
Source§fn delta_y_unaccel(&self) -> f64
fn delta_y_unaccel(&self) -> f64
Unaccelerated delta on the y axis between the last and new pointer device position
Source§impl TabletToolButtonEvent<LibinputInputBackend> for TabletToolButtonEvent
impl TabletToolButtonEvent<LibinputInputBackend> for TabletToolButtonEvent
Return the button that triggered this event.
For the button of a TabletToolButtonEvent,
return the total number of buttons pressed on all devices on the associated seat after the the event was triggered.
Return the button state of the event.
Source§impl<E> TabletToolEvent<LibinputInputBackend> for Ewhere
E: IsTabletEvent + EventTrait,
impl<E> TabletToolEvent<LibinputInputBackend> for Ewhere
E: IsTabletEvent + EventTrait,
Source§fn tool(&self) -> TabletToolDescriptor
fn tool(&self) -> TabletToolDescriptor
Get tablet tool that caused this event
Source§fn delta_x(&self) -> f64
fn delta_x(&self) -> f64
Delta on the x axis between the last and new pointer device position interpreted as pixel movement
Source§fn delta_y(&self) -> f64
fn delta_y(&self) -> f64
Delta on the y axis between the last and new pointer device position interpreted as pixel movement
Source§fn distance(&self) -> f64
fn distance(&self) -> f64
If this axis does not exist on the current tool, this function returns 0.
Source§fn distance_has_changed(&self) -> bool
fn distance_has_changed(&self) -> bool
Check if the distance axis was updated in this event.
Source§fn pressure(&self) -> f64
fn pressure(&self) -> f64
Returns the current pressure being applied on the tool in use, normalized to the range [0, 1]. Read more
Source§fn pressure_has_changed(&self) -> bool
fn pressure_has_changed(&self) -> bool
Check if the pressure axis was updated in this event.
Source§fn slider_position(&self) -> f64
fn slider_position(&self) -> f64
Returns the current position of the slider on the tool, normalized to the range
[-1, 1]. Read more
Source§fn slider_has_changed(&self) -> bool
fn slider_has_changed(&self) -> bool
Check if the slider axis was updated in this event.
Source§fn tilt_x(&self) -> f64
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. Read more
Source§fn tilt_x_has_changed(&self) -> bool
fn tilt_x_has_changed(&self) -> bool
Check if the tilt x axis was updated in this event.
Source§fn tilt_y(&self) -> f64
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. Read more
Source§fn tilt_y_has_changed(&self) -> bool
fn tilt_y_has_changed(&self) -> bool
Check if the tilt y axis was updated in this event.
Source§fn rotation(&self) -> f64
fn rotation(&self) -> f64
Returns the current z rotation of the tool in degrees, clockwise from the tool’s logical neutral position. Read more
Source§fn rotation_has_changed(&self) -> bool
fn rotation_has_changed(&self) -> bool
Check if the z-rotation axis was updated in this event.
Source§fn wheel_delta(&self) -> f64
fn wheel_delta(&self) -> f64
Return the delta for the wheel in degrees.
Source§fn wheel_delta_discrete(&self) -> i32
fn wheel_delta_discrete(&self) -> i32
Return the delta for the wheel in discrete steps (e.g. wheel clicks).
Source§fn wheel_has_changed(&self) -> bool
fn wheel_has_changed(&self) -> bool
Check if the wheel axis was updated in this event.
Source§fn delta(&self) -> Point<f64, Logical>
fn delta(&self) -> Point<f64, Logical>
Delta between the last and new pointer device position interpreted as pixel movement
Source§fn tilt(&self) -> (f64, f64)
fn tilt(&self) -> (f64, f64)
Returns the current tilt along the (X,Y) axis of the tablet’s current logical
orientation, in degrees off the tablet’s z axis. Read more
Source§fn tilt_has_changed(&self) -> bool
fn tilt_has_changed(&self) -> bool
Check if the tilt was updated in this event.
Source§impl TabletToolProximityEvent<LibinputInputBackend> for TabletToolProximityEvent
impl TabletToolProximityEvent<LibinputInputBackend> for TabletToolProximityEvent
Source§fn state(&self) -> ProximityState
fn state(&self) -> ProximityState
Returns the new proximity state of a tool from a proximity event. Read more
Source§impl TabletToolTipEvent<LibinputInputBackend> for TabletToolTipEvent
impl TabletToolTipEvent<LibinputInputBackend> for TabletToolTipEvent
Source§fn tip_state(&self) -> TabletToolTipState
fn tip_state(&self) -> TabletToolTipState
Returns the new tip state of a tool from a tip event. Read more
impl GestureHoldBeginEvent<LibinputInputBackend> for GestureHoldBeginEvent
impl GestureHoldEndEvent<LibinputInputBackend> for GestureHoldEndEvent
impl GesturePinchBeginEvent<LibinputInputBackend> for GesturePinchBeginEvent
impl GesturePinchEndEvent<LibinputInputBackend> for GesturePinchEndEvent
impl GestureSwipeBeginEvent<LibinputInputBackend> for GestureSwipeBeginEvent
impl GestureSwipeEndEvent<LibinputInputBackend> for GestureSwipeEndEvent
impl PointerMotionAbsoluteEvent<LibinputInputBackend> for PointerMotionAbsoluteEvent
impl TabletToolAxisEvent<LibinputInputBackend> for TabletToolAxisEvent
impl TouchCancelEvent<LibinputInputBackend> for TouchCancelEvent
impl TouchDownEvent<LibinputInputBackend> for TouchDownEvent
impl TouchFrameEvent<LibinputInputBackend> for TouchFrameEvent
impl TouchMotionEvent<LibinputInputBackend> for TouchMotionEvent
impl TouchUpEvent<LibinputInputBackend> for TouchUpEvent
Auto Trait Implementations§
impl Freeze for LibinputInputBackend
impl !RefUnwindSafe for LibinputInputBackend
impl !Send for LibinputInputBackend
impl !Sync for LibinputInputBackend
impl Unpin for LibinputInputBackend
impl !UnwindSafe for LibinputInputBackend
Blanket Implementations§
§impl<T> AsFilelike for Twhere
T: AsFd,
impl<T> AsFilelike for Twhere
T: AsFd,
§fn as_filelike(&self) -> BorrowedFd<'_>
fn as_filelike(&self) -> BorrowedFd<'_>
Borrows the reference. Read more
§fn as_filelike_view<Target>(&self) -> FilelikeView<'_, Target>where
Target: FilelikeViewType,
fn as_filelike_view<Target>(&self) -> FilelikeView<'_, Target>where
Target: FilelikeViewType,
Return a borrowing view of a resource which dereferences to a
&Target. Read more§impl<T> AsSocketlike for Twhere
T: AsFd,
impl<T> AsSocketlike for Twhere
T: AsFd,
§fn as_socketlike(&self) -> BorrowedFd<'_>
fn as_socketlike(&self) -> BorrowedFd<'_>
Borrows the reference.
§fn as_socketlike_view<Target>(&self) -> SocketlikeView<'_, Target>where
Target: SocketlikeViewType,
fn as_socketlike_view<Target>(&self) -> SocketlikeView<'_, Target>where
Target: SocketlikeViewType,
Return a borrowing view of a resource which dereferences to a
&Target. Read more§impl<T> AsSource for Twhere
T: AsFd,
impl<T> AsSource for Twhere
T: AsFd,
§fn source(&self) -> BorrowedFd<'_>
fn source(&self) -> BorrowedFd<'_>
Returns the borrowed file descriptor.
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
Mutably borrows from an owned value. Read more
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.