Skip to content

Commit 1fdfee4

Browse files
committed
Ignore missed events for inputs
1 parent fde7361 commit 1fdfee4

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

crates/bevy_input/src/gamepad.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1069,6 +1069,7 @@ impl GamepadConnectionEvent {
10691069
}
10701070

10711071
#[derive(Event, Debug, Clone, PartialEq, Reflect, FromReflect)]
1072+
#[event(missed = "ignore")]
10721073
#[reflect(Debug, PartialEq)]
10731074
#[cfg_attr(
10741075
feature = "serialize",
@@ -1094,6 +1095,7 @@ impl GamepadAxisChangedEvent {
10941095
/// Gamepad event for when the "value" (amount of pressure) on the button
10951096
/// changes by an amount larger than the threshold defined in [`GamepadSettings`].
10961097
#[derive(Event, Debug, Clone, PartialEq, Reflect, FromReflect)]
1098+
#[event(missed = "ignore")]
10971099
#[reflect(Debug, PartialEq)]
10981100
#[cfg_attr(
10991101
feature = "serialize",
@@ -1160,6 +1162,7 @@ pub fn gamepad_button_event_system(
11601162
/// [`GamepadButtonChangedEvent`] and [`GamepadAxisChangedEvent`] when
11611163
/// the in-frame relative ordering of events is important.
11621164
#[derive(Event, Debug, Clone, PartialEq, Reflect, FromReflect)]
1165+
#[event(missed = "ignore")]
11631166
#[reflect(Debug, PartialEq)]
11641167
#[cfg_attr(
11651168
feature = "serialize",

crates/bevy_input/src/keyboard.rs

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use bevy_reflect::{ReflectDeserialize, ReflectSerialize};
1919
/// The event is consumed inside of the [`keyboard_input_system`](crate::keyboard::keyboard_input_system)
2020
/// to update the [`Input<KeyCode>`](crate::Input<KeyCode>) resource.
2121
#[derive(Event, Debug, Clone, Copy, PartialEq, Eq, Reflect, FromReflect)]
22+
#[event(missed = "ignore")]
2223
#[reflect(Debug, PartialEq)]
2324
#[cfg_attr(
2425
feature = "serialize",

crates/bevy_input/src/mouse.rs

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use bevy_reflect::{ReflectDeserialize, ReflectSerialize};
1919
/// The event is read inside of the [`mouse_button_input_system`](crate::mouse::mouse_button_input_system)
2020
/// to update the [`Input<MouseButton>`](crate::Input<MouseButton>) resource.
2121
#[derive(Event, Debug, Clone, Copy, PartialEq, Eq, Reflect, FromReflect)]
22+
#[event(missed = "ignore")]
2223
#[reflect(Debug, PartialEq)]
2324
#[cfg_attr(
2425
feature = "serialize",
@@ -70,6 +71,7 @@ pub enum MouseButton {
7071
///
7172
/// [`DeviceEvent::MouseMotion`]: https://docs.rs/winit/latest/winit/event/enum.DeviceEvent.html#variant.MouseMotion
7273
#[derive(Event, Debug, Clone, Copy, PartialEq, Reflect, FromReflect)]
74+
#[event(missed = "ignore")]
7375
#[reflect(Debug, PartialEq)]
7476
#[cfg_attr(
7577
feature = "serialize",
@@ -111,6 +113,7 @@ pub enum MouseScrollUnit {
111113
///
112114
/// This event is the translated version of the `WindowEvent::MouseWheel` from the `winit` crate.
113115
#[derive(Event, Debug, Clone, Copy, PartialEq, Reflect, FromReflect)]
116+
#[event(missed = "ignore")]
114117
#[reflect(Debug, PartialEq)]
115118
#[cfg_attr(
116119
feature = "serialize",

crates/bevy_input/src/touch.rs

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ use bevy_reflect::{ReflectDeserialize, ReflectSerialize};
3131
/// This event is the translated version of the `WindowEvent::Touch` from the `winit` crate.
3232
/// It is available to the end user and can be used for game logic.
3333
#[derive(Event, Debug, Clone, Copy, PartialEq, Reflect, FromReflect)]
34+
#[event(missed = "ignore")]
3435
#[reflect(Debug, PartialEq)]
3536
#[cfg_attr(
3637
feature = "serialize",

0 commit comments

Comments
 (0)