Skip to content

Commit

Permalink
Ignore missed events for inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
CatThingy committed Jan 10, 2023
1 parent fde7361 commit 1fdfee4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/bevy_input/src/gamepad.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1069,6 +1069,7 @@ impl GamepadConnectionEvent {
}

#[derive(Event, Debug, Clone, PartialEq, Reflect, FromReflect)]
#[event(missed = "ignore")]
#[reflect(Debug, PartialEq)]
#[cfg_attr(
feature = "serialize",
Expand All @@ -1094,6 +1095,7 @@ impl GamepadAxisChangedEvent {
/// Gamepad event for when the "value" (amount of pressure) on the button
/// changes by an amount larger than the threshold defined in [`GamepadSettings`].
#[derive(Event, Debug, Clone, PartialEq, Reflect, FromReflect)]
#[event(missed = "ignore")]
#[reflect(Debug, PartialEq)]
#[cfg_attr(
feature = "serialize",
Expand Down Expand Up @@ -1160,6 +1162,7 @@ pub fn gamepad_button_event_system(
/// [`GamepadButtonChangedEvent`] and [`GamepadAxisChangedEvent`] when
/// the in-frame relative ordering of events is important.
#[derive(Event, Debug, Clone, PartialEq, Reflect, FromReflect)]
#[event(missed = "ignore")]
#[reflect(Debug, PartialEq)]
#[cfg_attr(
feature = "serialize",
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_input/src/keyboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use bevy_reflect::{ReflectDeserialize, ReflectSerialize};
/// The event is consumed inside of the [`keyboard_input_system`](crate::keyboard::keyboard_input_system)
/// to update the [`Input<KeyCode>`](crate::Input<KeyCode>) resource.
#[derive(Event, Debug, Clone, Copy, PartialEq, Eq, Reflect, FromReflect)]
#[event(missed = "ignore")]
#[reflect(Debug, PartialEq)]
#[cfg_attr(
feature = "serialize",
Expand Down
3 changes: 3 additions & 0 deletions crates/bevy_input/src/mouse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use bevy_reflect::{ReflectDeserialize, ReflectSerialize};
/// The event is read inside of the [`mouse_button_input_system`](crate::mouse::mouse_button_input_system)
/// to update the [`Input<MouseButton>`](crate::Input<MouseButton>) resource.
#[derive(Event, Debug, Clone, Copy, PartialEq, Eq, Reflect, FromReflect)]
#[event(missed = "ignore")]
#[reflect(Debug, PartialEq)]
#[cfg_attr(
feature = "serialize",
Expand Down Expand Up @@ -70,6 +71,7 @@ pub enum MouseButton {
///
/// [`DeviceEvent::MouseMotion`]: https://docs.rs/winit/latest/winit/event/enum.DeviceEvent.html#variant.MouseMotion
#[derive(Event, Debug, Clone, Copy, PartialEq, Reflect, FromReflect)]
#[event(missed = "ignore")]
#[reflect(Debug, PartialEq)]
#[cfg_attr(
feature = "serialize",
Expand Down Expand Up @@ -111,6 +113,7 @@ pub enum MouseScrollUnit {
///
/// This event is the translated version of the `WindowEvent::MouseWheel` from the `winit` crate.
#[derive(Event, Debug, Clone, Copy, PartialEq, Reflect, FromReflect)]
#[event(missed = "ignore")]
#[reflect(Debug, PartialEq)]
#[cfg_attr(
feature = "serialize",
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_input/src/touch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ use bevy_reflect::{ReflectDeserialize, ReflectSerialize};
/// This event is the translated version of the `WindowEvent::Touch` from the `winit` crate.
/// It is available to the end user and can be used for game logic.
#[derive(Event, Debug, Clone, Copy, PartialEq, Reflect, FromReflect)]
#[event(missed = "ignore")]
#[reflect(Debug, PartialEq)]
#[cfg_attr(
feature = "serialize",
Expand Down

0 comments on commit 1fdfee4

Please sign in to comment.