Module galileo::control

source ·
Expand description

This module contains traits and structs that provide interactivity of a Galileo map.

User interaction handling is done in several steps:

  1. OS event is converted to a common RawUserEvent enum. For example, apps that use winit can use WinitInputHandler to convert winit::event::WindowEvent into RawUserEvent.
  2. RawUserEvent is given to the EventProcessor, that converts it into a UserEvent. EventProcessor keeps track of input state (which keys, modifiers and mouse buttons) are pressed, and provides a more convenient way to handle user interactions for the application.
  3. EventProcessor has a list of UserEventHandlers, which change the state of application based on the events.

To write a user interaction logic, the app must provide an implementation of UserEventHandler trait and add it to the EventProcessor handler list.

Structs§

Enums§

  • Value returned by an UserEventHandler to indicate the status of the event.
  • Mouse button enum.
  • State of a mouse button.
  • Raw user interaction event. This type is an intermediate step between OS event and an event that will be processed by the application. It does not provide any state information, as not all supported platforms give this information together with the event. Instead, the input state information is stored in the EventProcessor struct, which can combine RawUserEvent with the state to produce UserEvent which is then given to the application.
  • User interaction event. This is the main type that the application would use through UserEventHandlers.

Traits§

Type Aliases§