Module input

Module input 

Source
Expand description

Systems for translating Bevy input messages into Egui input.

Structs§

EguiContextImeState
Indicates whether IME is enabled or disabled to avoid sending message duplicates.
EguiContextMessageReader
A helper system param to iterate over pairs of messages and Egui contexts, see EguiContextsMessageIterator.
EguiContextPointerPosition
Cached pointer position, used to populate egui::Event::PointerButton messages.
EguiContextPointerTouchId
Stores an active touch id.
EguiContextsMessageIterator
Iterates over pairs of (Message, Entity), where the entity points to the context that the message is related to.
EguiFileDragAndDropMessage
Wraps bevy::FileDragAndDrop messages emitted by crate::EguiInputSet systems.
EguiInputEvent
Wraps Egui messages emitted by crate::EguiInputSet systems.
EguiWantsInput
Stores whether there’s an Egui context using pointer or keyboard.
FocusedNonWindowEguiContext
Stores an entity of a focused non-window context (to push keyboard messages to).
HoveredNonWindowEguiContext
Insert this resource when a pointer hovers over a non-window (e.g. world-space) EguiContext entity. Also, make sure to update an EguiContextPointerPosition component of a hovered entity. Both updates should happen during crate::EguiInputSet::InitReading.
ModifierKeysState
Stores “pressed” state of modifier keys.
WindowToEguiContextMap
A bidirectional map between Window and EguiContext entities. Multiple contexts may belong to a single window.

Functions§

absorb_bevy_input_system
Clears Bevy input message buffers and resets ButtonInput resources if Egui is using pointer or keyboard (see the write_egui_wants_input_system run condition).
egui_wants_any_input
Returns true if any of the following is true: EguiWantsInput::wants_any_pointer_input, EguiWantsInput::wants_any_keyboard_input.
egui_wants_any_keyboard_input
Returns true if any of the following is true: EguiWantsInput::wants_keyboard_input, EguiWantsInput::is_context_menu_open.
egui_wants_any_pointer_input
Returns true if any of the following is true: EguiWantsInput::is_pointer_over_area, EguiWantsInput::wants_pointer_input, EguiWantsInput::is_using_pointer, EguiWantsInput::is_context_menu_open.
process_ime_system
Show the virtual keyboard when a text input is focused. Works by reading EguiOutput and calling Window::set_ime_allowed if the ime field is set.
write_egui_input_system
Reads both EguiFileDragAndDropMessage and EguiInputEvent messages and feeds them to Egui.
write_egui_wants_input_system
Updates the EguiWantsInput resource.
write_file_dnd_messages_system
Reads FileDragAndDrop messages and wraps them into EguiFileDragAndDropMessage, can redirect messages to HoveredNonWindowEguiContext.
write_ime_messages_system
Reads Ime messages and wraps them into EguiInputEvent, can redirect messages to FocusedNonWindowEguiContext.
write_keyboard_input_messages_system
Reads KeyboardInput messages and wraps them into EguiInputEvent, can redirect messages to FocusedNonWindowEguiContext.
write_modifiers_keys_state_system
Reads KeyboardInput messages to update the ModifierKeysState resource.
write_mouse_wheel_messages_system
Reads MouseWheel messages and wraps them into EguiInputEvent, can redirect messages to HoveredNonWindowEguiContext.
write_non_window_pointer_moved_messages_system
Reads CursorMoved messages and wraps them into EguiInputEvent for a HoveredNonWindowEguiContext context (if one exists).
write_non_window_touch_messages_system
Reads TouchInput messages and wraps them into EguiInputEvent for a HoveredNonWindowEguiContext context (if one exists).
write_pointer_button_messages_system
Reads MouseButtonInput messages and wraps them into EguiInputEvent, can redirect messages to HoveredNonWindowEguiContext, inserts, updates or removes the FocusedNonWindowEguiContext resource based on a hovered context.
write_window_pointer_moved_messages_system
Reads MouseButtonInput messages and wraps them into EguiInputEvent (only for window contexts).
write_window_touch_messages_system
Reads TouchInput messages and wraps them into EguiInputEvent.