Struct three::Input
[−]
[src]
pub struct Input { /* fields omitted */ }
Controls user and system input from keyboard, mouse and system clock.
Methods
impl Input
[src]
pub fn reset(&mut self)
[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.
pub fn delta_time(&self) -> f32
[src]
Get current delta time (time since previous frame) in seconds.
pub fn keys_hit(&self) -> &[Key]
[src]
Get list of all keys hit since the last frame.
pub fn mouse_pos(&self) -> Point2<f32>
[src]
Get current mouse pointer position in pixels from top-left.
pub fn mouse_pos_ndc(&self) -> Point2<f32>
[src]
Get current mouse pointer position in Normalized Display Coordinates.
See map_to_ndc
.
pub fn mouse_wheel_movements(&self) -> &[f32]
[src]
Get list of all mouse wheel movements since last frame.
pub fn mouse_wheel(&self) -> f32
[src]
Get summarized mouse wheel movement (the sum of all movements since last frame).
pub fn mouse_movements(&self) -> &[Vector2<f32>]
[src]
Get list of all mouse movements since last frame in pixels.
pub fn mouse_movements_ndc(&self) -> &[Vector2<f32>]
[src]
Get list of all mouse movements since last frame in NDC.
pub fn axes_movements(&self) -> &[(u8, f32)]
[src]
Get list of all raw inputs since last frame.
pub fn mouse_delta(&self) -> Vector2<f32>
[src]
Get summarized mouse movements (the sum of all movements since last frame) in pixels.
pub fn mouse_delta_ndc(&self) -> Vector2<f32>
[src]
Get summarized mouse movements (the sum of all movements since last frame) in NDC.
pub fn mouse_delta_raw(&self) -> Vector2<f32>
[src]
Get summarized raw input along 0
and 1
axes since last frame.
It usually corresponds to mouse movements.
pub fn is_focused(&self) -> bool
[src]
Return whether Window
is in focus or not.
pub fn hit<H: Hit>(&self, hit: H) -> bool
[src]
pub fn delta<D: Delta>(&self, delta: D) -> <D as Delta>::Output
[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.
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.
None
when no updates to the axis are received andSome(x)
wherex
is the sum of positive and negative inputs otherwise.
pub fn timed<D: Delta>(&self, delta: D) -> Option<f32>
[src]
Shortcut for delta
*
delta_time
.