Skip to main content

Crate game_toolkit_input

Crate game_toolkit_input 

Source
Expand description

Input subsystem: keyboard + mouse + gamepads + touch, with held / just-pressed / just-released semantics.

Call Input::handle_window_event for every winit::event::WindowEvent and Input::poll_gamepads once per frame before update, then Input::end_frame once per frame after update to clear edge state.

Structs§

Gamepad
Per-controller state, with the same held / just-pressed / just-released model as the keyboard. Obtain via Input::gamepads or Input::first_gamepad.
GamepadId
Gamepad ID.
Input
Touch
One finger on a touchscreen. Positions are in physical pixels, the same space as Input::mouse_pos. Obtain via Input::touches, Input::touches_started or Input::touches_ended.

Enums§

Axis
Gamepad’s elements which state can be represented by value from -1.0 to 1.0.
Button
Gamepad’s elements which state can be represented by value from 0.0 to 1.0.
Key
Code representing the location of a physical key
MouseButton