[][src]Struct three::Input

pub struct Input { /* fields omitted */ }

Controls user and system input from keyboard, mouse and system clock.

Methods

impl Input
[src]

Manually reset current Input state.

Usually there is no need in using this method, because Window resets Input on each update method by default.

It will discard all mouse or raw axes movements and also all keyboard hits. Moreover, delta time will be recalculated.

Get current delta time (time since previous frame) in seconds.

Get list of all keys hit since the last frame.

Get current mouse pointer position in pixels from top-left.

Get current mouse pointer position in Normalized Display Coordinates. See map_to_ndc.

Get list of all mouse wheel movements since last frame.

Get summarized mouse wheel movement (the sum of all movements since last frame).

Get list of all mouse movements since last frame in pixels.

Get list of all mouse movements since last frame in NDC.

Get list of all raw inputs since last frame.

Get summarized mouse movements (the sum of all movements since last frame) in pixels.

Get summarized mouse movements (the sum of all movements since last frame) in NDC.

Get summarized raw input along 0 and 1 axes since last frame. It usually corresponds to mouse movements.

Return whether Window is in focus or not.

Returns true there is any input info from Button, axis::Key or axis::Raw. Otherwise returns false.

Returns the change ('delta') in input state since the last call to Window::update.

This value depends on the type of input device is given.

axis::Key

  • None when no updates to the axis are received.
  • Some(1) when only positive input to the axis is received.
  • Some(-1) when only negative input to the axis is received.
  • Some(0) when both positive and negative input to the axis is received.

axis::Raw

  • None when no updates to the axis are received and
  • Some(x) where x is the sum of positive and negative inputs otherwise.

Shortcut for delta * delta_time.

Returns the amount of:

  • Hits for Button as u8.

  • Hits for axis::Key as (u8, u8) where first number is for positive direction and the second one is for negative.

Auto Trait Implementations

impl Send for Input

impl Sync for Input

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> SetParameter for T

Sets value as a parameter of self.

impl<T> Erased for T