[−][src]Module ggez::event
The event
module contains traits and structs to actually run your game mainloop
and handle top-level state, as well as handle input events such as keyboard
and mouse.
If you don't want to use ggez
's built in event loop, you can
write your own mainloop and check for events on your own. This is
not particularly hard, there's nothing special about the
EventHandler
trait. It just tries to simplify the process a
little. For examples of how to write your own main loop, see the
source code for this module, or the eventloop
example.
Re-exports
pub use crate::input::gamepad::GamepadId; |
pub use crate::input::keyboard::KeyMods; |
Modules
winit_event |
|
Structs
EventLoop |
|
Enums
Axis | An analog axis of some device (gamepad thumbstick, joystick...). |
Button | A button of some device (gamepad, joystick...). |
ControlFlow |
|
KeyCode | Symbolic name for a keyboard key. |
MouseButton | A mouse button. |
Traits
EventHandler | A trait defining event callbacks. This is your primary interface with
|
Functions
quit | Terminates the |
run | Runs the game's main loop, calling event callbacks on the given state object as events occur. |