pub enum PlatformInput {
Show 15 variants
KeyDown(KeyDownEvent),
KeyUp(KeyUpEvent),
ModifiersChanged(ModifiersChangedEvent),
MouseDown(MouseDownEvent),
MouseUp(MouseUpEvent),
MousePressure(MousePressureEvent),
MouseMove(MouseMoveEvent),
MouseExited(MouseExitEvent),
Scroll(ScrollEvent),
Pinch(PinchEvent),
LongPress(LongPressEvent),
TouchDrag(TouchDragEvent),
BackGesture(BackGestureEvent),
FileDrop(FileDropEvent),
Touch(TouchEvent),
}Expand description
An enum corresponding to all kinds of platform input events.
Variants§
KeyDown(KeyDownEvent)
A key was pressed.
KeyUp(KeyUpEvent)
A key was released.
ModifiersChanged(ModifiersChangedEvent)
The keyboard modifiers were changed.
MouseDown(MouseDownEvent)
The mouse was pressed.
MouseUp(MouseUpEvent)
The mouse was released.
MousePressure(MousePressureEvent)
Mouse pressure.
MouseMove(MouseMoveEvent)
The mouse was moved.
MouseExited(MouseExitEvent)
The mouse exited the window.
Scroll(ScrollEvent)
A mouse wheel or trackpad scrolled. Touch pans reach the window as
PlatformInput::Touch and are recognized into scrolls by GPUI.
Pinch(PinchEvent)
A pinch gesture was performed.
LongPress(LongPressEvent)
A long-press gesture recognized from touch input.
TouchDrag(TouchDragEvent)
A direct touch drag claimed by an element.
BackGesture(BackGestureEvent)
A back-navigation gesture recognized by the platform.
FileDrop(FileDropEvent)
Files were dragged and dropped onto the window.
Touch(TouchEvent)
A raw touch event on a touch screen.
Implementations§
Source§impl PlatformInput
impl PlatformInput
Sourcepub fn kind_name(&self) -> &'static str
pub fn kind_name(&self) -> &'static str
A short static name for this input’s variant, for diagnostics and telemetry.
Sourcepub fn touch_event(&self) -> Option<&TouchEvent>
pub fn touch_event(&self) -> Option<&TouchEvent>
Returns the touch event contained in this input, if any.
Trait Implementations§
Source§impl Clone for PlatformInput
impl Clone for PlatformInput
Auto Trait Implementations§
impl Freeze for PlatformInput
impl RefUnwindSafe for PlatformInput
impl Send for PlatformInput
impl Sync for PlatformInput
impl Unpin for PlatformInput
impl UnsafeUnpin for PlatformInput
impl UnwindSafe for PlatformInput
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more