If I want a system reacting on a mouse button press, it looks like this:
use bevy::{
input::{keyboard::ElementState, mouse::MouseButtonInput},
prelude::*,
};
fn mouse_click(
mut state: ResMut<State>,
mouse_button_input_events: Res<Events<MouseButtonInput>>,
) {
for event in state
.mouse_button_event_reader
.iter(&mouse_button_input_events)
{
if event.state == ElementState::Pressed {
It is odd to have to use ElementState from input::keyboard to handle input::mouse event.
I needed to "search all files" on Bevy repo to find out where I need to import this symbol from.
Should we move it to bevy::input?
If I want a system reacting on a mouse button press, it looks like this:
It is odd to have to use
ElementStatefrominput::keyboardto handleinput::mouseevent.I needed to "search all files" on Bevy repo to find out where I need to import this symbol from.
Should we move it to
bevy::input?