-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
A-InputPlayer input via keyboard, mouse, gamepad, and morePlayer input via keyboard, mouse, gamepad, and moreC-FeatureA new feature, making something new possibleA new feature, making something new possible
Description
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?
Metadata
Metadata
Assignees
Labels
A-InputPlayer input via keyboard, mouse, gamepad, and morePlayer input via keyboard, mouse, gamepad, and moreC-FeatureA new feature, making something new possibleA new feature, making something new possible