pub struct WinitInputHelper { /* fields omitted */ }
Pass every event to this function.
WinitInputHelper::Update
is easier to use.
But this method is useful if you want to inspect the events yourself before giving them to WinitInputHelper
.
Ensure this method is only called once per application main loop.
Ensure every event since the last update_from_vec
call is included in the events
argument.
Takes every event from the events_loop.
If you need to inspect the events yourself use WinitInputHelper::update_from_vec
.
Ensure this method is only called once per application main loop.
Returns true when the specified keyboard key goes from "not pressed" to "pressed"
Otherwise returns false
Returns true when the specified mouse button goes from "not pressed" to "pressed"
Otherwise returns false
Left => 0
Right => 1
Middle => 2
Other => 3..255
Returns true when the specified keyboard key goes from "pressed" to "not pressed"
Otherwise returns false
Returns true when the specified mouse button goes from "pressed" to "not pressed"
Otherwise returns false
Left => 0
Right => 1
Middle => 2
Other => 3..255
Returns true while the specified keyboard key remains "pressed"
Otherwise returns false
Returns true while the specified mouse button remains "pressed"
Otherwise returns false
Left => 0
Right => 1
Middle => 2
Other => 3..255
Returns true while any shift key is held on the keyboard
Otherwise returns false
Returns true while any control key is held on the keyboard
Otherwise returns false
Returns true while any alt key is held on the keyboard
Otherwise returns false
Returns 0.0
if the mouse is outside of the window.
Otherwise returns the amount scrolled by the mouse in between the last two update*()
calls
Returns None
when the mouse is outside of the window.
Otherwise returns the mouse coordinates in pixels
Returns None
when the mouse is outside of the window.
Otherwise returns the mouse coordinates in the game world.
Returns the difference in mouse coordinates between the last two update*()
calls
Returns (0.0, 0.0)
if the mouse is outside of the window.
Returns the difference in mouse coordinates between the last two update*()
calls
Returns (0.0, 0.0)
if the mouse is outside of the window.
Returns None
when the mouse is outside of the window.
Otherwise returns the resolution of the window.
Returns the characters pressed since the last update*()
.
The earlier the character was pressed, the lower the index in the Vec.
Returns the path to a file that has been drag-and-dropped onto the window.
Returns true if the OS has requested the application to quit.
Otherwise returns false.