[−][src]Enum nannou::event::WindowEvent
A simplified version of winit's WindowEvent
type to make it easier to get started.
All co-ordinates and dimensions are DPI-agnostic scalar values.
Co-ordinates for each window are as follows:
(0.0, 0.0)
is the centre of the window.- positive
x
points to the right, negativex
points to the left. - positive
y
points upwards, negativey
points downwards. - positive
z
points into the screen, negativez
points out of the screen.
Variants
The window has been moved to a new position.
KeyPressed(Key)
The given keyboard key was pressed.
KeyReleased(Key)
The given keyboard key was released.
The mouse moved to the given x, y position.
MousePressed(MouseButton)
The given mouse button was pressed.
MouseReleased(MouseButton)
The given mouse button was released.
The mouse entered the window.
The mouse exited the window.
MouseWheel(MouseScrollDelta, TouchPhase)
A mouse wheel movement or touchpad scroll occurred.
The window was resized to the given dimensions.
HoveredFile(PathBuf)
A file at the given path was hovered over the window.
DroppedFile(PathBuf)
A file at the given path was dropped onto the window.
A file at the given path that was hovered over the window was cancelled.
Touch(TouchEvent)
Received a touch event.
TouchPressure(TouchpadPressure)
Touchpad pressure event.
At the moment, only supported on Apple forcetouch-capable macbooks. The parameters are: pressure level (value between 0 and 1 representing how hard the touchpad is being pressed) and stage (integer representing the click level).
The window gained focus.
The window lost focus.
The window was closed and is no longer stored in the App
.
Methods
impl WindowEvent
[src]
pub fn from_winit_window_event(
event: WindowEvent,
win_w: f64,
win_h: f64
) -> Option<Self>
[src]
event: WindowEvent,
win_w: f64,
win_h: f64
) -> Option<Self>
Produce a simplified, new-user-friendly version of the given winit::WindowEvent
.
This strips rarely needed technical information from the event type such as information about the source device, scancodes for keyboard events, etc to make the experience of pattern matching on window events nicer for new users.
This also interprets the raw pixel positions and dimensions of the raw event into a
dpi-agnostic scalar value where (0, 0, 0) is the centre of the screen with the y
axis
increasing in the upwards direction.
If the user requires this extra information, they should use the raw
field of the
WindowEvent
type rather than the simple
one.
Trait Implementations
impl Clone for WindowEvent
[src]
fn clone(&self) -> WindowEvent
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl PartialEq<WindowEvent> for WindowEvent
[src]
fn eq(&self, other: &WindowEvent) -> bool
[src]
fn ne(&self, other: &WindowEvent) -> bool
[src]
impl Debug for WindowEvent
[src]
Auto Trait Implementations
impl Send for WindowEvent
impl Unpin for WindowEvent
impl Sync for WindowEvent
impl UnwindSafe for WindowEvent
impl RefUnwindSafe for WindowEvent
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Style for T where
T: Any + Debug + PartialEq<T>,
[src]
T: Any + Debug + PartialEq<T>,
impl<T> Content for T
[src]
fn ref_from_ptr(ptr: *mut c_void, size: usize) -> Option<*mut T>
[src]
fn is_size_suitable(size: usize) -> bool
[src]
fn indiv_size() -> usize
[src]
impl<T> SafeBorrow<T> for T
[src]
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
D: AdaptFrom<S, Swp, Dwp, T>,
Dwp: WhitePoint,
Swp: WhitePoint,
T: Component + Float,
[src]
D: AdaptFrom<S, Swp, Dwp, T>,
Dwp: WhitePoint,
Swp: WhitePoint,
T: Component + Float,
fn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
[src]
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into(self) -> D
[src]
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,