Struct three::Input [] [src]

pub struct Input { /* fields omitted */ }

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

Methods

impl Input
[src]

[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.

[src]

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

Important traits for &'a mut [u8]
[src]

Get list of all keys hit since the last frame.

[src]

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

[src]

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

Important traits for &'a mut [u8]
[src]

Get list of all mouse wheel movements since last frame.

[src]

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

Important traits for &'a mut [u8]
[src]

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

Important traits for &'a mut [u8]
[src]

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

Important traits for &'a mut [u8]
[src]

Get list of all raw inputs since last frame.

[src]

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

[src]

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

[src]

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

[src]

Return whether Window is in focus or not.

[src]

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

[src]

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.

[src]

Shortcut for delta * delta_time.

[src]

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.

Trait Implementations

Auto Trait Implementations

impl Send for Input

impl Sync for Input